I have two mp3 files: audio1.mp3
and audio2.mp3
.
I am currently able to play them both at the same time by using Python subprocess and ffplay. (Using Windows' PowerShell currently, but answers regarding a Linux systems are also appreciated)
FFPLAY_EXE_PATH = "ffmpeg\\ffplay.exe"
subprocess.Popen(f"{FFPLAY_EXE_PATH} audio1.mp3", shell=True)
subprocess.Popen(f"{FFPLAY_EXE_PATH} audio2.mp3", shell=True)
I am also currently able to change my computer's audio output device through the PowerShell using AudioDeviceCmdlets:
$ Get-AudioDevice -list | ft Index, Default, Type, Name
Index Default Type Name
----- ------- ---- ----
1 True Playback Speakers (Echo Dot-EMQ Stereo)
2 False Playback Speakers (Realtek(R) Audio)
3 True Recording Microphone Array (Realtek(R) Audio)
$ Set-AudioDevice -Index 2 # < Works fine
The big problem here is: if I change the output device (as shown in the last command), it changes it for everything currently running.
I would like to make it so that, while I am playing audio1.mp3
in "AudioDevice 1", at the same time, play audio2.mp3
through "AudioDevice 2".
A idea I've had was to somehow use stereo audio, but I'm not quite sure if that would work/how it would work.