Search code examples
audioalsa

ALSA: Use plugin in c code while playing sound


I'm playing a wav sound file with some c code such as this. It uses all the APIs:

snd_pcm_*

I would like to use the equalizer plugin:

libasound_module_ctl_equal.so, libasound_module_pcm_equal.so

found in "libasound2-plugin-equal"

How can I integrate and call an Alsa plugin from c code?


Solution

  • The answer is simpler that I imagined:

    snd_pcm_open(&pcm_handle, "equal", SND_PCM_STREAM_PLAYBACK, 0) < 0);
    

    You can pass the name of the plugin to snd_pcm_open with the right set of default file.