I need to be able to simultaneously play several files on my headless Raspberry Pi and dynamically changing their volumes, preferably with Python.
I managed to get it to work with the swmixer Python library but it is based on pyaudio (itself based on portaudio) which is known to stutter on the BCM chipset of the Pi.
sounddevice & soundfile libraries seems to play flawlessly but I'd have to port swmixer to use it instead of pyaudio and that's a lot of work.
Then I thought of going lower-level and use ALSA utils such as
aplay to play and
amixer to change the volume, using dmix to create a software mixer, but right now I can't make dmix work even with the official base configuration.
What other alternatives do I have to programmatically play/pause/stop and change volume of multiple tracks on a headless Raspberry Pi?