snd_pcm_channel_audio_ducking()

Enable or disable audio ducking

Synopsis:

#include <sys/asoundlib.h>

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

Arguments:

pcm
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().
channel
The channel direction. The only valid value is SND_PCM_CHANNEL_PLAYBACK.
enable
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.

Library:

libasound.so

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

Description:

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.

Returns:

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

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

Errors:

-EINVAL
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.
-ENOTSUP
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.

Classification:

QNX Neutrino

Safety:  
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread No