Stop the PCM playback channel and discard the contents of its queue
#include <sys/asoundlib.h> int snd_pcm_playback_drain( snd_pcm_t *handle );
Use the -l asound option to qcc to link against this library.
The snd_pcm_playback_drain() function stops the PCM playback channel associated with handle and causes it to discard all audio data in its buffers. This all happens immediately.
If the operation is successful (zero is returned), the channel's state is changed to SND_PCM_STATUS_READY.
EOK on success, a negative errno upon failure. The errno values are available in the errno.h file.
- The state of the handle is invalid or an invalid state change ocurred, or the PCM device state isn't ready.You can call snd_pcm_channel_status() to check if the state change was invalid.
|Thread||Read the Caveats|
This function is not thread safe if handle (snd_pcm_t) is used across multiple threads.
Last modified: 2014-06-24