Simple script to run an ambient audio track?
-
Hi Guys,
I'm VERY new to Retropie and Linux, but I'm having a lot of fun learning about it and pushing what it can do. I've recently added the MAME boarder overlays onto my system, and had a thought that it would be cool if we could implement some ambient noise of an arcade into the background while you play an emulator.
As I've said I'm totally new to all this so I may be being very short sighted but it doesn't seem like it would need many lines of script or be too hard to run one ambient .mp3 in the background while an emulator is running. It could be written into either the MAME retroarch config for all games or a rom config, to be ran on per game basis. I have an ambient audio track from an arcade which is over an hour long.
The only scripts I can imagine it would require are that:
- it would need a script to load a background music player.
- start and stop the audio at the start and exit of emulation.
- set the playback volume.
I found a post by someone on this forum called livewire who has made a script to add randomised menu music to Retropie, wouldn't it be possible to streamline this script for this use as it would barely need half of the rules required for randomised menu music. I'm pretty terrible at reading the code myself, but the main useful bits I would assume would be which music player is used (it seems to be - pygame mixer) and how its is loaded in the background then and how the file is played and plus its volume, start and end is all specified.
What do you guys think, am I being naive, is it going to be harder than it seems? all opinions or replies are welcome :-)
thanks
-
@vanhalen2466
I think you can achiev it with some shell scripting knowledge, mpg123 and runcommand-onstart. But I'm not sure if the soundtrack and the ingame sound will play together harmoniously...[Edit: oh... maybe you need to kill mpg123 in runcommand-onend]
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.