Playing multiple wav files using ALSA in C with di

2019-07-24 04:07发布

问题:

I need to play more than 2 wav files using ALSA library C interface. Each file should be played with different volumes but it should be possible to play them simultaneously. I am using embedded linux on a board with sgtl5000 device. I get only one entry for playback device as pcm0p. Please let me know how to play multiple sounds together with different volumes. Please let me know if you require more details. Thanks in advance

回答1:

If the ALSA library has been compiled with the dmix plugin, just open the device named plug:dmix for each file.