Prosody speech processing: API: sm_put_replay_data

Prototype Definition

int sm_put_replay_data(struct sm_ts_data_parms *datap)

Parameters

*datap
a structure of the following type:
typedef struct sm_ts_data_parms {
	tSMChannelId channel;					/* in */
	char *data;						/* in */
	tSM_INT length;						/* in */
} SM_TS_DATA_PARMS;

Description

Following a call to sm_replay_start(), as sm_replay_status() indicates that the channel is ready for successive amounts of data, the actual data to be replayed is supplied to the module via successive invocations of this function. The data parameter is a pointer to a buffer of data to replay in the appropriate format, and the length parameter gives the number of octets of valid data in the buffer.

Only on Prosody version 1: For a definite length replay job (invoked with sm_replay_start() passed data_length set to a non-zero definite replay length) the sum of the length parameters in the successive invocations of sm_put_replay_data() must equal the data_length parameter in the preceding call to sm_replay_start(). Normally length must be set to kSMMaxReplayDataBufferSize octets, however the final call in the sequence must set length to the remaining number of octets of replay data (data_length % kSMMaxReplayDataBufferSize). The call sm_put_last_replay_data() may not be used to supply data for a definite length replay job.

For an indefinite length replay job (invoked with sm_replay_start() passed zero data_length), data should be supplied using successive invocations of sm_put_replay_data() with length set to kSMMaxReplayDataBufferSize octets, and then the final call in the sequence must be to sm_put_last_replay_data() with length set to the remaining number of octets of replay data.

Only on Prosody version 2 (TiNG): The data should be presented in lengths which are multiples of four bytes because this is more efficiently handled than other lengths.

Only on Prosody version 1: If the module has insufficient capacity to buffer all the given data, then no data will be buffered and the call will return the status ERR_SM_NO_CAPACITY.
Only on Prosody version 2 (TiNG): If the module has insufficient capacity to buffer all the given data, then some data may be transferred and the call may return the status ERR_SM_NO_CAPACITY or it may block until space is available.

The application may be stimulated by a driver sent event when capacity on a channel becomes available (see sm_channel_set_event).

Fields

channel
The channel which is replaying.
data
The data being provided.
length
The length of the data being provided.

Returns

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


This function is part of the Prosody speech processing API.