Prosody speech processing: API: sm_put_audio_data

Prototype Definition

int sm_put_audio_data(struct sm_audio_data_parms *datap)

Parameters

*datap
a structure of the following type:
typedef struct sm_audio_data_parms {
	tSMChannelId channel;					/* in */
	char *data;						/* in */
	tSM_INT max_length;					/* in */
	tSM_INT done_length;					/* out */
} SM_AUDIO_DATA_PARMS;

Description

Following a call to sm_channel_set_output_threshold() set up with negative minimum_bits threshold, and a call to sm_replay_start(), each time 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 max_length parameter gives the number of octets of valid data in the buffer.

The data should be presented in lengths which are multiples of four bytes because this is more efficiently handled than other lengths.

If the module is not yet ready to buffer data, then no data is transferred and the call will return with done_length set to zero.

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.
max_length
The length of the data being provided.
done_length
The amount of data actually written.

Returns

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


This function is part of the Prosody speech processing API.