<> <> <> DIRECTORY RefID USING [ ID, nullID ], Thrush USING [ Credentials, NB, none, SHHH ] ; VoiceTemp: CEDAR DEFINITIONS = { <> <<>> <> TuneID: TYPE = INT; -- the index of a "tune" or similar utterance identification. nullTuneID: TuneID = -1; newTuneID: TuneID = -2; VoiceTime: TYPE = INT; -- A sample number or sample count. VoiceDirection: TYPE = { play, record }; <> <<>> <> IntID: TYPE = LONG CARDINAL; nullIntID: IntID = 0; EnergyRange: TYPE = NAT; IntervalSpec: TYPE = REF IntervalSpecBody; IntervalSpecBody: TYPE = RECORD [ tuneID: TuneID_newTuneID, start: VoiceTime_0, -- first sample within tune to play or record. length: VoiceTime_-1, -- number of samples: -1 to play to the end. keyIndex: [0..17B] _ 0, intID: IntID _ nullIntID, ambientLevel: EnergyRange _ 0 ]; IntervalSpecs: TYPE = LIST OF IntervalSpec; <> <> <> <<{ $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.>> Play: PROCEDURE [ shhh: Thrush.SHHH_Thrush.none, credentials: Thrush.Credentials, serviceID: RefID.ID, intervalSpec: IntervalSpec, queueIt: BOOL_TRUE ] RETURNS [nb: Thrush.NB]; <> <> <<{ $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.>> Record: PROCEDURE [ shhh: Thrush.SHHH_Thrush.none, credentials: Thrush.Credentials, -- requesting party's serviceID: RefID.ID, -- in this case, the recording service's SmartsID intervalSpec: IntervalSpec, queueIt: BOOL_TRUE ] RETURNS [nb: Thrush.NB, tuneID: TuneID]; <> <> <<{ $recording, $abandoned, intID } as indicated above.>> Stop: PROCEDURE [ shhh: Thrush.SHHH_Thrush.none, credentials: Thrush.Credentials, serviceID: RefID.ID ] RETURNS [nb: Thrush.NB]; <> <> <> <> <<>> DescribeInterval: PROC [ shhh: Thrush.SHHH_Thrush.none, credentials: Thrush.Credentials, serviceID: RefID.ID _ RefID.nullID, -- Not used targetInterval: IntervalSpec, minSilence: VoiceTime _ 1 -- Smallest silent interval that will be considered silence. ] RETURNS [ nb: Thrush.NB, length: INT, intervals: IntervalSpecs ]; <> }. <> <> <<>> <<>>