int sm_record_bfile_progress_istatus(SM_BFILE_RECORD_PARMS *file_parms, int initial_status)
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_bfile_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. Otherwise the
recording has finished. If the status is zero then
recording has been successful, if it is non-zero, the record has
been terminated on error, and the status will be set to a
corresponding error code. In either case,
sm_record_bfile_complete()
must be called to clean up after the recording.
Note: this routine must be periodically invoked following a call to sm_record_bfile_start(). This may either be done explicitly by the application, or alternatively through a call to sm_record_bfile_complete() which will handle the scheduling of calls to sm_record_bfile_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.
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 BFILE play/record API.