Ok so this may be somewhat off topic sorry.
Thought id seen something like this somewhere on the forum after discussing the use of per layout ambient audio.Would it be possible to use this code for background ambient audio similar to what recalbox uses on the main console selection menu (not sure how well this would work alongside snap video audio) or to trigger per layout console power on sounds (sega) . Also i see retrofe has triggers on the following events: "load" (page load), "unload" (page exit), "highlight" (scroll), "select" (entering game/sub-menu) mentioned in the configuration documentation.
Attract mode appears to have far more configurable sounds : select, up, down, page up, page down, previous display, next display, displays menu, previous filter, next filter, filters menu, toggle layout, toggle movie,toggle mute, toggle rotate right, toggle flip, toggle rotate left, exit (confirm), exit to desktop, screenshot, configure, random game, replay last game, add/remove favourite,previous favourite, next favourite, add/remove tags, screen saver, previous letter, next letter, intro, exit game, custom1-6, ambient soundtrack, startup sound, game return sound.
But as there is little documentation on sound (I had to manually check my config menu to list these). I am curious can sound files be applied to these settings by a layout or must they be pre configured by user and thus static. There seems to be little work done on using sounds within attract mode i see plenty of great work on graphics for layouts. But i have yet to come across a layout that has included sounds or simply a stand alone sound pack.
So thank you for coding something related to sound and for reading this long and off topic post. I know some may feel sounds are annoying but i enjoyed switching sound packs on my pc and the classic windows 95 startup and shutdown sounds and hyperspins wheel switch sounds. I just hope to improve my attract mode experience.