1

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

mohan
  • 11
  • 2

1 Answers1

1

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

CL.
  • 173,858
  • 17
  • 217
  • 259
  • And if not (or it's not possible to recompile alsa) my answer to [this](http://stackoverflow.com/questions/14540261/what-is-a-good-tool-for-programmatically-playing-multiple-audio-files-at-the-sam/14540691#14540691) question outlines a generic approach for software mixing. – marko Feb 05 '13 at 20:11
  • Hi, Thanks for quick response. I can open the device 'plug:dmix' for each file and I am able to play multiple sounds simultaneously. Is there a way to set volume for playing each file separately(while playing them together) in ALSA? – mohan Feb 06 '13 at 05:04
  • There is no predefined plugin for this. Just change the samples when you're writing them to the device. – CL. Feb 06 '13 at 08:27