VoiceRope.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Last Edited by: Swinehart, January 31, 1986 7:11:13 pm PST
Doug Terry, April 9, 1986 3:00:46 pm PST
This interface is an update of the old Intervoice interface to include routines for editing voice ropes, as well as recording and playing them. Eventually this should be renamed to replace the current Intervoice.
DIRECTORY
FinchSmarts USING [Procs],
LoganBerry USING [OpenDB],
RefID USING [nullID],
Rope USING [ROPE];
VoiceRope:
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;
Voice rope operations take a handle as their first parameter; if handle is omitted, one will be invented using all the defaults.
Handle: TYPE = REF HandleRec;
HandleRec:
TYPE =
RECORD [
-- Used to be opaque, but changed for now
procs: FinchSmarts.Procs←NIL,
vdbHandle: VoiceDBHandle,
Complain: PROC[complaint: Rope.ROPE]
];
VoiceDBHandle: TYPE = REF VoiceDBHandleRec;
VoiceDBHandleRec:
TYPE =
RECORD [
voiceRopeDB: LoganBerry.OpenDB←RefID.nullID,
voiceInterestDB: LoganBerry.OpenDB←RefID.nullID,
voiceRopeDBName: Rope.ROPE,
voiceInterestDBName: Rope.ROPE,
instance: Rope.ROPE,
imported: BOOL←FALSE
];
Open:
PROC [voiceRopeDBName: Rope.
ROPE ←
NIL, voiceRopeDBInstance: Rope.
ROPE ←
NIL, localName: Rope.
ROPE ←
NIL,
Complain:
PROC[complaint: Rope.
ROPE] ←
NIL]
RETURNS [handle: Handle];
If voiceRopeDBName, voiceRopeDBInstance, 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.
Creating and playing voice ropes
Record:
PROC[handle: Handle←
NIL]
RETURNS [voiceRope: VoiceRope];
Records a voice rope, registers it , and returns its ID. A NIL return value indicates that something went wrong.
Play:
PROC[handle: Handle←
NIL, voiceRope: VoiceRope, queueIt:
BOOL←
TRUE, failOK:
BOOL←
FALSE, wait:
BOOL←
FALSE];
Play a specified voice rope. The boolean arguments are interpreted as follows:
queueIt => play after all other record/playback requests are satisfied.
failOK => playing is optional; leave connection open if tune doesn't exist.
wait => wait until things appear to be started properly, or have failed.
N.B.: System noises, like Beeps and intolerably cute rollback tunes used to be indexed in the refsToTunesDB database as refID's like "beep", "rollback", and so on, under the refIDType "SysNoises". How to manage these things in the context of voice ropes needs to be resolved.
Stop:
PROC[handle: Handle ←
NIL];
Stops any recording or playback in progress.
Interests in voice ropes
Retain:
PROC [
Existence of refID retains interest in voiceFileID until corresponding Forget.
Creator is assumed to be logged-in user.
handle: Handle ← NIL,
voiceRope: VoiceRope,
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: Handle ← NIL,
refID: Rope.ROPE,
refIDType: Rope.ROPE
];
Editing voice ropes
Cat:
PROC [handle: Handle ←
NIL, vr1, vr2, vr3, vr4, vr5: VoiceRope ←
NIL]
RETURNS [new: VoiceRope];
Concatenates together the non-NIL voice ropes to produce a new voice rope.
Substr:
PROC [handle: Handle ←
NIL, vr: VoiceRope, start:
INT ← 0, len:
INT ←
LAST[
INT]]
RETURNS [new: VoiceRope];
Creates a new voice rope that is a substring of an existing voice rope.
Replace:
PROC [handle: Handle ←
NIL, vr: VoiceRope, start:
INT ← 0, len:
INT ←
LAST[
INT], with: VoiceRope ←
NIL]
RETURNS [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 [handle: Handle ←
NIL, vr: VoiceRope]
RETURNS [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 [handle: Handle ← NIL, vr: VoiceRope, minSilence: INT ← -1] RETURNS [noise: IntervalSpecs];
Fetch: PROC [handle: Handle ← NIL, vr: VoiceRope, index: INT] RETURNS [VoiceSample];
}.
Swinehart, January 30, 1986 9:34:42 am PST
Created from WalnutVoiceImpl routines; voice message facilities, without Walnut specifics
Doug Terry, March 22, 1986 1:32:03 pm PST
Changed recording and playback routines to deal in voice ropes instead of tunes; upgraded interest management; added facilities for editing voice ropes.
changes to: VoiceRope, Record, Play, Retain, Forget, Cat, Substr, Replace, Length
Doug Terry, April 8, 1986 11:12:55 pm PST
Changed voice ropes from simple IDs to IDs and intervals.
changes to: VoiceRope, Record, Play, Retain, Cat, Substr, Replace, Length, Retain, DescribeRope
Doug Terry, April 9, 1986 10:24:11 am PST
All operations can now default their handle parameter to NIL.
changes to: VoiceRope, Record, Play, Stop, Retain, Forget, Cat, Substr, Replace, Length, DescribeRope