Playing Multiple Audio Files At Once On Local Machine

Hello everyone!

I have a question for you guys. I’m trying to play multiple audio files at once through Home Assistant for one of the escaperooms i maintain. One file is an ambient/background sound and other sounds will be warnings for example. I tried a configuration with Home Assistant Supervised in Docker + Mopidy, but could not get it to work. Current setup:

Ubuntu 20.04 on a HP EliteDesk
Home Assistant installer as user hass in a virtual env
I wrote the following lines:
“cvlc -q --alsa-audio-device=hw:1,0 /home/hass/Music/ambience.mp3 &> /dev/null &”
“cvlc -q --alsa-audio-device=hw:1,0 /home/hass/Music/test.mp3 &> /dev/null &”

If I run this command in the shell, they will overlap. Exactly the behaviour I want, but if I add the commands as shell commands in my configuration.yaml, they can be executed, but if one of the files is playing, I cannot start the other sound. I can however execute different shell commands, such as “pkill vlc”

Why isn’t this working? It think it has something to do with the audio output being occupied, but why would it work if I do it manually then? I wrote the lines in such a way, that they do not hang the script. Also tried putting them in a shell script and firing the shell scripts from HA, but with the same result.

Is there a way to get this lines working, or is there any other/better way to play multiple audio files at once on a local instance? Preferrably with Home Assistant Supervised? Thank you very much!

P.s. this is my first post. I love Home Assistant! Currently built 4 Escaperooms with it and I never have any problems :slight_smile:

My wife and I have done a few of these and every time I leave I think, “why don’t they do more automation and use Home Assistant to do it…”

Where are your escape rooms?