Intervoice.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Last Edited by: Swinehart, January 31, 1986 7:11:13 pm PST
Intervoice:
CEDAR
DEFINITIONS = {
For now, procedures for managing recorded voice; later, intend to launder FinchSmarts routines for telephone management and include them here.
Handle: TYPE=REF HandleRec;
Open:
PROC [
If tunesDBName, tunesDBInstance, or localName is omitted, a default based on the user profile choice of Thrush Server is invented. If Complain is omitted, Log.Problem[...$Finch] is used. See VoiceDB for meaning of the names.
tunesDBName: Rope.ROPE ← NIL,
tunesDBInstance: Rope.ROPE ← NIL,
localName: Rope.ROPE ← NIL,
Complain: PROC[complaint: Rope.ROPE] ← NIL
]
RETURNS[handle: Handle];
In all the routines that follow, if handle is omitted, one will be invented using all the defaults.
Record:
PROC[handle: Handle←
NIL]
RETURNS [voiceFileID: Rope.
ROPE];
Records a tune, registers it in the VoiceDB, returns its ID.
NIL return value indicates that something went wrong.
Play:
PROC[
handle: Handle←NIL,
Play a specified utterance.
refID: Rope.
ROPE←
NIL, refIDType: Rope.
ROPE←
NIL, voiceFileID: Rope.
ROPE←
NIL,
Either refID or voiceFileID must be NIL; if refID#NIL, refIDType must be non-NIL
queueIt: BOOL←TRUE, -- play after all other record/playback requests are satisfied.
failOK: BOOL←FALSE, -- playing is optional; leave connection open if tune doesn't exist.
wait: BOOL←FALSE -- wait until things appear to be started properly, or have failed
];
N.B.: System noises, like Beeps and intolerably cute rollback tunes are indexed in the refsToTunesDB database as refID's like "beep", "rollback", and so on, under the refIDType "SysNoises"
Stop:
PROC[handle: Handle];
Stops any recording or playback in progress.
Retain:
PROC [
Existence of refID retains interest in voiceFileID until corresponding Forget.
Creator is assumed to be logged-in user.
handle: Intervoice.Handle,
voiceFileID: Rope.ROPE,
refID: Rope.ROPE,
refIDType: Rope.ROPE
];
Forget:
PROC [
Remove refID from database, eliminating its interest in any voiceFileID's
Creator is assumed to be logged-in user.
handle: Intervoice.Handle,
refID: Rope.ROPE,
refIDType: Rope.ROPE
];
}.