Set the system's source mode (plugin-aware)
#include <sys/asoundlib.h>
unsigned int snd_pcm_plugin_set_src_mode(
snd_pcm_t *handle,
unsigned int src_mode,
int target );
- handle
- The handle for the PCM device, which you must have opened by calling
snd_pcm_open()
or
snd_pcm_open_preferred().
- src_mode
- The sample rate conversion mode; one of the following:
- SND_SRC_MODE_NORMAL — (default mode; all previous
version of SRC work this way) SRC ratio based on input/output block size
rounded towards zero. Floor(input size/output size).
- SND_SRC_MODE_ACTUAL — fixed SRC which adjusts
the input fragment size dynamically to prevent roundoff error from
adjusting the playback speed.
- SND_SRC_MODE_ASYNC — asynchronous SRC which
adjusts the input fragment size to maintain a specified buffer fullness.
- target
- The level in percent for the buffer fullness measurement used in the
asynchronous sample rate conversion.
libasound.so
The snd_pcm_plugin_set_src_mode() function sets the type of
sample rate conversion to use.
Only playback modes are supported.
The source mode (also in handle->plugin_src_mode) that the
system is set to.
QNX Neutrino
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
Make sure that you don't mix and match plugin- and nonplugin-aware functions
in your application, or you may get undefined behavior and misleading results.
snd_pcm_plugin_update_src(),
snd_pcm_plugin_src_max_frag()