I have the following setup:
Ubuntu 12.04 Server, MOC running with alsa and a custom ruby app which is playing soundfiles occasionally (e.g. an advertisement mp3 every 20 minutes, or a happy_hour mp3 if some event happens and so on)
The ruby app is event or scheduled drived with his internal logic and the server is connected to the sound system of our store.
Now i want to use the same server (and the already established connection to the sound system of the store) to play mp3s out of a playlist.
this works fine by now but one thing i really have to change:
when MOC is playing a song and the ruby app wants to play an advertisment, they are all on the same sound level and advertisment get drowned out by the music playing. Is there a way i can:
a) set up moc to run on a virtual sound line, so i can seperate the ruby and moc daemons from one another and separately adjust the sound levels of each applications
and the importan one
b) can i tell MOC, alsa or what every application, that as long as a sound is played from the ruby app (or from a specific sound line), fade down MOC (or the MOC-virtual-sound-line/device) by 90% and, as soon as the other application stops playing readjust the soundlevel of moc back to it's origin?
thanks for your help