Prosody high level FILE play/record: API: sm_record_file_progress_istatus

Prototype Definition

int sm_record_file_progress_istatus(SM_FILE_RECORD_PARMS *file_parms, int initial_status)

Parameters

file_parms
A pointer to a structure passed into sm_record_file_start() to start recording that has not yet indicated that it has finished.
initial_status
A recent status returned from sm_record_status().

Description

Transfers data from a recording channel to file for a previously initiated record unless the channel has insufficient buffered data to collect, or all data in recording has been collected, or an error occurs.

If the current record status for the channel is not known, then the sm_record_file_progress() variant of the call must be used.

On return if the status field is still set to a value of ERR_SM_PENDING then further calls to this routine will be required to complete the file record. If the status is zero then recording successfully completed, otherwise the record has been terminated on error, and the status will be set to a corresponding error code.

Note: this routine must be periodically invoked following a call to sm_record_file_start(). This may either be done explicitly by the application, or alternatively through a call to sm_record_file_complete() which will handle the scheduling of calls to sm_record_file_progress() on behalf of the application.

Note that the sampling_rate of the record_parms structure is not updated to the recorded sample rate, as returned by sm_record_status(). If the recording is to a WAV file, then this is must be done by the application before closing the WAV file. Otherwise the WAV header will not have the correct values.

Returns

The same value as stored in the status field of the structure pointed to by file_parms which is 0 or ERR_SM_PENDING if call completed successfully, otherwise a standard error such as:


This function is part of the Prosody high level FILE play/record API.