Playing multiple sources at the same time with mopidy

Hi All,

i wonder whether is it possible to mix two mp3 sources in real time with mopidy, so the user can listen them as one stream.
for example a live stream is playing, and in case of an incoming message i would like to inform the listener about the event.
any feedback is highly appreciated.

An ALSA dmix plugin allows multiple processes to use the same audio hardware at the same time. E.g. Mopidy and your event sound playing program.

huge thanks for the answer. i’m going to check the dmix plugin!

I had the same challenge and just worked around Mopidy. As kingosticks mentioned, you can just use a “dmix” sound output for Mopidy and another application in parallel.

$aplay -L
    ADD ON USB Cinema system, USB Audio
    Direct sample mixing device

Then use mpg123 or another sound player
/usr/bin/mpg123 -a dmix:system welcome.mp3 >/dev/null 2>&1

I made a post about doing something similar to what you are talking about using pulseaudio here Although the post is geared toward Home Assistant the concept should work for anything that can connect to pulseaudio.

thanks for all the answers!