I am using a python app (with rhasspy-hermes-app) to respond to my intents, and one of the things my application does is stream sound. I have not been able to get this to work, as the aplay command that Rhasspy uses seems to want exclusive use of the audio device.
When I start multiple pygame instances that all play sound, that does work fine.
My client application is playing sound through PyGame, which uses SDL2. Rhasspy uses aplay which plays through ALSA. I have seen some solutions posted that propose creating a software mixer in my ALSA config, but since I am playing my other sound through SDL, I am not sure this will work (I did try, it didn’t work, but then I might need to do more debugging).
I am wondering if anyone has tips on how to approach this? I think I can take a few approaches:
- implement a python script that reads WAV from stdin and plays it through PyGame
- set Rhasspy to play through MQTT, and handle those MQTT messages inside my app, playing sounds with PyGame. I have not been able to find any docs around how to respond to these messages.
- something else?
Any advice here would be highly appreciated!