DIRECTORY FinchSmarts USING [Procs], LoganBerry USING [OpenDB], RefID USING [nullID], Rope USING [ROPE]; VoiceRope: CEDAR DEFINITIONS = { 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; 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]; Record: PROC[handle: Handle_NIL] RETURNS [voiceRope: VoiceRope]; Play: PROC[handle: Handle_NIL, voiceRope: VoiceRope, queueIt: BOOL_TRUE, failOK: BOOL_FALSE, wait: BOOL_FALSE]; Stop: PROC[handle: Handle _ NIL]; Retain: PROC [ handle: Handle _ NIL, voiceRope: VoiceRope, refID: Rope.ROPE, refIDType: Rope.ROPE ]; Forget: PROC [ handle: Handle _ NIL, refID: Rope.ROPE, refIDType: Rope.ROPE ]; Cat: PROC [handle: Handle _ NIL, vr1, vr2, vr3, vr4, vr5: VoiceRope _ NIL] RETURNS [new: VoiceRope]; Substr: PROC [handle: Handle _ NIL, vr: VoiceRope, start: INT _ 0, len: INT _ LAST[INT]] RETURNS [new: VoiceRope]; Replace: PROC [handle: Handle _ NIL, vr: VoiceRope, start: INT _ 0, len: INT _ LAST[INT], with: VoiceRope _ NIL] RETURNS [new: VoiceRope]; Length: PROC [handle: Handle _ NIL, vr: VoiceRope] RETURNS [len: INT]; DescribeRope: PROC [handle: Handle _ NIL, vr: VoiceRope, minSilence: INT _ -1] RETURNS [noise: IntervalSpecs]; }. HVoiceRope.mesa Copyright c 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. 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. Voice rope operations take a handle as their first parameter; if handle is omitted, one will be invented using all the defaults. 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 Records a voice rope, registers it , and returns its ID. A NIL return value indicates that something went wrong. 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. Stops any recording or playback in progress. Interests in voice ropes Existence of refID retains interest in voiceFileID until corresponding Forget. Creator is assumed to be logged-in user. Remove refID from database, eliminating its interest in any voiceFileID's Creator is assumed to be logged-in user. Editing voice ropes Concatenates together the non-NIL voice ropes to produce a new voice rope. Creates a new voice rope that is a substring of an existing voice rope. Creates a new voice rope in which the given interval of the voice rope "vr" is replaced by the voice rope "with". 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 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 Κ<˜šœ™Icodešœ Οmœ1™