FinchSynthesizer.mesa
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
Last Edited by: Swinehart, September 20, 1990 4:39:42 pm PDT
DIRECTORY
RefID USING [ ID, nullID ],
Rope USING [ ROPE ],
Synthesizer USING [ ActionID, nullActionID, SynthSpec, SynthSpecs ],
SynthesizerServerRpcControl USING [ InterfaceRecord ],
Thrush USING [ ConversationID, NB, nullConvID, SHHH ]
;
FinchSynthesizer: CEDAR DEFINITIONS = {
Types
NB: TYPE = Thrush.NB;
SConvDesc: TYPE = REF SConvDescBody;
SConvDescBody: TYPE = RECORD [
Per-conversation data relating to text-to-speech synthesis.
stateChange: CONDITION, -- for waiting for state of conversation to change.
pendingSpecs: Synthesizer.SynthSpecs ← NIL,
$requested, ~ ($finished or $abandoned)
synthesizerServiceID: RefID.ID ← RefID.nullID, -- See FinchSynthesizerImpl for the RPC interface.
synthInterface: SynthesizerServerRpcControl.InterfaceRecord ← NIL,
synthShhh: Thrush.SHHHNIL
];
Text-to-speech server
These procedures allow simple access to one or more text-to-speech synthesizers. The system provides defaults for the choice of synthesizer, how to interpret the text that is supplied, and so on. The user can supply a translation procedure to improve the interpretation of the text, either by registering a default, or by providing it in a call. There should be procedures to provide for pitch-changes, phoneme-level submissions, other special features.
The procedure types TextToSpeechProc, StopSpeechProc, and RegisterTranslateProcType are defined in order to allow the creation of object-style interfaces to these facilities.
TextToSpeechProc: TYPE = PROC
-- TAKES -- [
convID: Thrush.ConversationID←Thrush.nullConvID,
synthSpec: Synthesizer.SynthSpec,
queueIt: BOOLTRUE,
synthesizerTranslateProc: SynthesizerTranslateProc←NIL,
synthesizerModel: ATOMNIL,
synthesizerVersion: ATOMNIL]
RETURNS [
nb: Thrush.NB←$success,
newConvID: Thrush.ConversationID,
newActionID: Synthesizer.ActionID
];
TextToSpeech: TextToSpeechProc;
Send rope to text-to—speech server. Called with rope = the current selection by FinchTool's SpeakText button. Input rope will be modified by the translate proc if (a) one is specified with this call or (b) one has previously been specified via RegisterTranslateProc[proc] below. Model and version parameters default to the current system choice. Some operations may not be available, depending on which model is assigned. I'm not satisfied with where this stuff is specified.
SpeakText: PROC[textToSpeak: Rope.ROPE] RETURNS [nb: NB];
Simple procedure that just says what you tell it, if it can.
StopSpeechProc: TYPE = PROC [convID: Thrush.ConversationID ← Thrush.nullConvID, actionID: Synthesizer.ActionID ← Synthesizer.nullActionID]
RETURNS [
nb: Thrush.NB←$success,
newConvID: Thrush.ConversationID,
newActionID: Synthesizer.ActionID
];
StopSpeech: StopSpeechProc;
Flushes text-to-speech server queues, halts current speech.
ResetSynthesizer: PROC[convID: Thrush.ConversationID] RETURNS [nb: Thrush.NB];
Flushes text-to-speech server queues, initiates Synthesizer self-test, and resets all speech parameters. Intended as an escape hatch.
RegisterTranslateProcType: TYPE = PROC [conversationID: Thrush.ConversationID,
translate: SynthesizerTranslateProc←NIL];
RegisterTranslateProc: RegisterTranslateProcType;
Register default translate procedure to be used by TextToSpeech to make the text rope more intelligible. Most useful as a way to modify the action of the FinchTool's SpeakText button.
GetSynthesizerSpecifications: PROC[conversationID: Thrush.ConversationID]
RETURNS [nb: Thrush.NB←$success, synthesizerModel: ATOM, synthesizerVersion: ATOM];
Describe the assigned synthesizer.
SynthesizerTranslateProc: TYPE = PROC [inText: Rope.ROPE] RETURNS [outText: Rope.ROPE];
A translate proc is used to modify the text rope to make it more intelligible. Examples: 1) words that the synthesizer doesn't pronounce correctly could be respelled or given as phonemes, and 2) synthesizer commands to alter speech speed or pitch could be added.
InitializeFinchSynthesizer: PROC;
}.
Swinehart, September 25, 1986 9:10:34 am PDT
Extracted from FinchSmarts, FinchProse, ProseTranslateProc