Alsa: How to Duplicate a Stream on 2 Outputs and Save System Configs

ALSA Api: How to play two wave files simultaneously?

ALSA does not provide a mixer. If you need to play multiple audio streams at the same time, you need to mix them together on your own.

The easiest way this can be accomplished is by decoding the WAV files to float samples, add them, and clip them when converting them back to integer samples.

Alternatively, you can try to open the default audio device (and not a hardware device like "hw:0") multiple times, once for each stream you wish to play, and hope that the dmix ALSA plugin is loaded and will provide the mixing functionality.

ALSA configuration to enable device sharing between multiple processes

As far as I have searched and checked, there is apparently no concrete way to do this in ALSA. I can share the built-in default device between multiple processes, but any other configuration didn't provide this functionality. Also, I couldn't find any programmatic way to configure an ALSA device. The configuration file seems to be the only way to do this.



Related Topics



Leave a reply



Submit