VoiceRopeServer.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Last Edited by: Swinehart, June 25, 1986 10:03:13 am PDT
Doug Terry, August 25, 1986 4:34:23 pm PDT
VoiceRopeServer is a voice service interface. It is exported to $recording service parties to provide access to procedures for recording and playing voice, and for VoiceRope editing activities.
DIRECTORY
RefID USING [ID],
Rope USING [ROPE],
Thrush USING [Credentials, NB, none, SHHH]
;
VoiceRopeServer: CEDAR DEFINITIONS = {
All of the VoiceRope operations actually deal with intervals of voice ropes. Naive clients can simply ignore the start and length fields and treat a voice rope as simply an ID; clients concerned about performance can alter the interval values associated with a voice rope as an alternative to performing Substr operations. For newly created voice ropes, the start field is always 0 and the length field contains the actual number of samples in the voice rope.
VoiceRope: TYPE = REF VoiceRopeInterval;
VoiceRopeInterval:
TYPE =
RECORD [
ropeID: Rope.ROPE,
start: INT,
length: INT
];
Interval: TYPE = RECORD[start, length: INT];
IntervalSpecs: TYPE = LIST OF Interval;
Creating and playing voice ropes
Before calling the following operations, clients must establish a voice conversation directly with Bluejay, the voice file server.
Record:
PROC[shhh: Thrush.
SHHH ← Thrush.none, credentials: Thrush.Credentials, serviceID: RefID.
ID, intID:
CARD ← 0, queueIt:
BOOL ←
TRUE]
RETURNS [nb: Thrush.
NB, voiceRope: VoiceRope];
Records a voice rope, registers it, and returns its ID. The following action reports are generated if intID#0:
{ $recording, $started, intID } when recording begins.
{ $recording, $finished, intID } when the recording of this interval has finished.
{ $recording, $abandoned, intID } when all recording and playback actions ending with this interval has been flushed.
Play:
PROC[shhh: Thrush.
SHHH ← Thrush.none, voiceRope: VoiceRope, credentials: Thrush.Credentials, serviceID: RefID.
ID, intID:
CARD ← 0, queueIt:
BOOL ←
TRUE]
RETURNS [nb: Thrush.
NB];
Play a specified voice rope. If queueIt is FALSE, flush existing playback and recording requests, first. The following action reports are generated if intID#0:
{ $recording/$playback, $started, intID } as the interval begins playing/recording.
{ $recording/$playback, $scheduled, intID } as the interval is accepted for recording/playback, if there is already a list of pieces in the queue ahead of this request.
{ $recording/$playback, $finished, intID } when the interval has finished.
{ $recording/$playback, $abandoned, intID } when all recording and playback actions ending with this interval has been flushed.
Stop:
PROC[shhh: Thrush.
SHHH ← Thrush.none
, credentials: Thrush.Credentials, serviceID: RefID.
ID]
RETURNS [nb: Thrush.
NB];
Stop playing or recording some or all of the scheduled intervals.
Action reports are generated if intID#0 was specified in original request:
{ $recording, $abandoned, intID } as indicated above.
Note: When the conversation is terminated before all recording/playback actions have occurred, reporting is problematical. Currently, the requesting party may well not receive any reports after idling the conversation (hanging up, for instance.) This interface, however, remains available, so that the DescribeRope function is available for finding out how much was recorded, and so on.
Interests in voice ropes
Clients must explicitly express an interest in retaining a voice rope in order to prevent it from being garbage collected. Interests belong to a particular class; different applications employing voice ropes can use different interest classes to control how those voice ropes are managed.
The refID and other parameters are class-specific. For instance, a class "TiogaVoice" may use refID to record the name of the Tioga file containing a voice rope. The other field can be used to store data such as a timeout.
InterestClass: TYPE ~ Rope.ROPE;
Retain:
PROC [shhh: Thrush.
SHHH ← Thrush.none, vr: VoiceRope, class: InterestClass, refID: Rope.
ROPE, other: Rope.
ROPE ←
NIL]
RETURNS [nb: Thrush.
NB];
Registers a new interest in the voice rope. The voice rope will be retained until either a corresponding Forget is done or the class' garbage collection process determines that the voice rope is no longer referenced, e.g. refID no longer exists. Taken together, the vr, class, and refID must be unique. Repeated calls of Retain with the same parameters (ignoring other) will only register a single interest.
Forget:
PROC [shhh: Thrush.
SHHH ← Thrush.none, vr: VoiceRope, class: InterestClass, refID: Rope.
ROPE]
RETURNS [nb: Thrush.
NB];
The specified refID of the specified class drops its interest in the voice rope. The voice rope is not necessarily deleted, however, since other interests in the same voice rope may exist.
GetByInterest:
PROC [shhh: Thrush.
SHHH ← Thrush.none, class: InterestClass, refID: Rope.
ROPE]
RETURNS [nb: Thrush.
NB, voiceRope: VoiceRope];
Returns any voice rope that is of interest to the given class and refID; returns NIL if no such voice rope exists.
Note: System noises, like Beeps and intolerably cute rollback tunes are indexed in the interest database as refID's like "beep", "rollback", and so on, under the class "SysNoises".
Editing voice ropes
Cat:
PROC [shhh: Thrush.
SHHH ← Thrush.none, vr1, vr2, vr3, vr4, vr5: VoiceRope ←
NIL]
RETURNS [nb: Thrush.
NB, new: VoiceRope];
Concatenates together the non-NIL voice ropes to produce a new voice rope.
Substr:
PROC [shhh: Thrush.
SHHH ← Thrush.none, vr: VoiceRope, start:
INT ← 0, len:
INT ←
LAST[
INT]]
RETURNS [nb: Thrush.
NB, new: VoiceRope];
Creates a new voice rope that is a substring of an existing voice rope.
Replace:
PROC [shhh: Thrush.
SHHH ← Thrush.none, vr: VoiceRope, start:
INT ← 0, len:
INT ←
LAST[
INT], with: VoiceRope ←
NIL]
RETURNS [nb: Thrush.
NB, new: VoiceRope];
Creates a new voice rope in which the given interval of the voice rope "vr" is replaced by the voice rope "with".
Length:
PROC [shhh: Thrush.
SHHH ← Thrush.none, vr: VoiceRope]
RETURNS [nb: Thrush.
NB, len:
INT];
Returns the actual length of the voice rope. This operation ignores the start and length values specified in the voice rope. Thus, vr.start ← 0; vr.length ← Length[handle, vr] will restore a voice rope to its full contents.
Information about voice ropes
DescribeRope:
PROC [shhh: Thrush.
SHHH ← Thrush.none, vr: VoiceRope, minSilence:
INT ← -1]
RETURNS [nb: Thrush.
NB, length:
INT, noise: IntervalSpecs];
Describe the loud and silence intervals within the specified interval. nb is $success or $noSuchTune. Also indicates the total length of the tune.
Fetch: PROC [shhh: Thrush.SHHH ← Thrush.none, vr: VoiceRope, index: INT] RETURNS [nb: Thrush.NB, VoiceSample];
}.
Doug Terry, July 28, 1986 5:44:18 pm PDT
Voice rope service interface for recording, playing, and editing stored voice.
changes to: IntervalSpecs, Retain, Forget, GetByInterest, Cat, Substr, Replace, Length, DescribeRope, DIRECTORY, Record, Play, Stop, InterestClass
Doug Terry, August 25, 1986 4:34:23 pm PDT
changes to: DIRECTORY, Record, Play, Stop