Prosody speech processing: API: sm_replay_status

Prototype Definition

int sm_replay_status(struct sm_replay_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_replay_status_parms {
	tSMChannelId channel;					/* inout */
	enum kSMReplayStatus {
		kSMReplayStatusComplete,
		kSMReplayStatusCompleteData,
		kSMReplayStatusUnderrun,
		kSMReplayStatusHasCapacity,
		kSMReplayStatusNoCapacity,
	} status;						/* out */
	/* Only in Prosody version 2 (TiNG) */
	tSM_UT32 offset;					/* out */
	/* End of part only in Prosody version 2 (TiNG) */
} SM_REPLAY_STATUS_PARMS;

Description

This call, typically invoked in response to a write event being signalled, allows an application to determine the status of replay jobs.

In order to determine the status of a specific replay job on a particular output channel, the application should set channel to specify the job concerned. On successful completion, the status field indicates the current status of the channel.

In order to determine the replay job that has completed or would most benefit from more data, on calling sm_replay_status the application should set channel to kSMNullChannelId. On return, if any replay job exists that would benefit from more data, channel will be set to the identifier for the output channel corresponding to that job and status will be set to one of the values kSMReplayStatusComplete, kSMReplayStatusHasCapacity or kSMReplayStatusUnderrun. If no such replay job exists, then channel will remain set to kSMNullChannelId and the call will return ERR_SM_NO_SUCH_CHANNEL.

Only on Prosody version 2 (TiNG): When you set channel to kSMNullChannelId, the only channels which can be indicated as being ready are those which have been registered for 'any channel' write operation using sm_channel_set_event() See Prosody TiNG: any channel operation for how to do this.

A channel ceases to be replaying when this function returns a status of kSMReplayStatusComplete. Until this happens, the channel output is reserved for the replay and cannot be used for anything else. After this happens, the channel output returns to being idle and consequently if this function is used again it will return the error ERR_SM_NO_REPLAY_IN_PROGRESS.

Fields

channel
The channel which is replaying.
status
The channel's status. One of these values:
kSMReplayStatusComplete
the replay job has completed, all module buffered data has been transmitted on the channel
kSMReplayStatusCompleteData
the replay job is still ongoing, all required data for replay has been supplied, the replay job will complete once all module buffered data has been transmitted
kSMReplayStatusUnderrun
data has not been supplied sufficiently frequently to replay job and the output has been padded out with silence
kSMReplayStatusHasCapacity
the replay job is still ongoing and the module has capacity to buffer further data for the job
kSMReplayStatusNoCapacity
the replay job is still ongoing and either all the replay data has now been received by the module or the module temporarily does not have capacity to buffer further data for the job
offset (Only in Prosody version 2 (TiNG))
The number of octets which had been played when the replay completed.

Returns

0 if call completed successfully, otherwise a standard error such as:


This function is part of the Prosody speech processing API.