Enable or disable audio ducking


#include <sys/asoundlib.h>

int snd_pcm_channel_audio_ducking( snd_pcm_t *pcm,
                                   int channel,
                                   uint32_t enable );


A handle to the PCM device, which you must have opened by calling snd_pcm_open_name(), snd_pcm_open(), or snd_pcm_open_preferred().
The channel direction. The only valid value is SND_PCM_CHANNEL_PLAYBACK.
An integer value that specifies whether to enable or disable audio ducking on the specified channel. A zero indicates to disable audio ducking while a non-zero values indicates to enable audio ducking. Once enabled, the channel conforms to the behavior specified by the audio ducking algorithms enabled on the system.


Use the -l asound option with qcc to link against this library.


The snd_pcm_channel_audio_ducking() function permits audio ducking to occur for the specified channel (audio stream), regardless of its streaming state. By default, an audio stream is part of the audio policy algorithm that's described in the Audio Concurrency Management chapter of this guide. If audio ducking isn't configured on the system, then this function doesn't have an effect on the specified audio channel.


EOK on success, a negative errno upon failure. The errno values are available in the errno.h file.

If no audio policy configuration file is provided, this function returns EOK.


The handle (pcm) is invalid, the specified channel (channel) has an invalid file descriptor, or the channel direction (channel) is invalid (e.g., SND_PCM_CHANNEL_CAPTURE isn't a valid channel direction for this function). This error also occurs if the channel is in the SND_PCM_STATUS_NOTREADY state.
If the call is targeted against a PCM interface that doesn't have the PCM software mixer enabled. The mixer is required to perform audio concurrency management.


QNX Neutrino

Cancellation point Yes
Interrupt handler No
Signal handler No
Thread No