I’m trying to use Python to play simultaneous separate audio files through *individual channels on a single audio device* (either the built in RPi audio output, or an Octo card). For example, playing two mono files at the same time, one in the
left channel, one in the right independent of each other.
There are a bunch of Python packages out there that use audio I/O libraries such as PortAudio to play files, and PortAudio for example allows you to pick specific channels for playback in some situations, but not for Raspberry Pi.
It is trivial to play a single sound file on all channels at once but being able to specifically pick which channels to send to is proving extremely challenging.
I'm also trying to configure the ALSA audio framework to treat the channels of a single
device as multiple separate (virtual) devices - (as described here for example:
https://bootlin.com/blog/audio-multi-channel-routing-and-mixing-using-alsalib/)
but the instructions in that blog are not clear - I’m having a bit of difficulty figuring out the complete configuration to put in the asound.conf file. (If anyone thinks they’d be able to assist me to
make sense of asound syntax, I’d be very happy!)
Has anyone attempted parallel/thread-driven playback of different audio files on different channels on a RPI’s audio device?
Tanks -
Ian