Synopsis:
SMmode(vox_chan,non_blocking)
Arguments:
vox_chan – The voice channel
non_blocking – Set to 0 for blocking mode, 1 to one-shot non-blocking mode, 2 for continuous non_blocking mode.
Description: This function allows for certain speech functions (such as SMplay(), SMrecord() etc) to be carried out in either blocking or non-blocking mode. All of the speech functions that operate in this way are known as blocking speech functions. In blocking mode the calling Telecom Engine task will block until the speech function has completed after which the function will return with the terminating event that caused the blocking speech function to complete. In non-blocking mode the function will return immediately and the speech function will continue playing in the background while the Telecom Engine task continues processing. In this case it is up to the program to wait for the operation to complete (using SMstate()) or to specifically abort the speech operation using SMabort().
See Blocking and Non-blocking Mode for more information.
If the non_blocking argument is set to 0 then this causes all subsequent blocking speech functions to block the calling telecom Engine task (this is the default behaviour).
If the non-blocking flag is set to 1 then the next blocking speech function will operate in non-blocking mode after which further calls to blocking speech functions will block the calling task as normal.
If the non-blocking flag is set to 1 then the next blocking speech function will operate in non-blocking mode and a call to SMmode() with the non-blocking flag set to 0 will be required to set the channel back to blocking mode again.
Returns: Returns 0 is successful or a negative error code.