the problem is, that attract.exe blocks that file.
so you can't change it on the fly, if attract.exe is running (idea was to change that file after a few seconds via external software (batch, autoit, AHK,.. in background/besides attract)
I don't have a attractmode integrated solution.
but this quick and dirty solution via external software like autoit:
start this autoit script along with attract.exe:
#include <file.au3>
while 1
$sourceFolder = "C:\attract\sounds"
$aFileList = _FileListToArray($sourceFolder, "*.mp3", 1)
$iRandom = Random(1,$aFileList[0],1)
If ProcessExists ("vlc.exe") Then
sleep(100)
if ProcessExists ("mame.exe") Then
ProcessClose("vlc.exe")
EndIf
If ProcessExists ("notepad.exe") Then
ProcessClose("vlc.exe")
EndIf
Else
run ('C:\Program Files\VideoLAN\VLC\vlc.exe --quiet --qt-start-minimized --play-and-exit ' & $sourceFolder & "\" & $aFileList[$iRandom] & ' vlc://quit')
EndIf
WEnd
-disable Windows Popup VLC Notification in vlc.exe :
Here-script choose a random .mp3 file from a specific folder (here : C:\attract\sounds )
-when song ends, next random .mp3 starts
-sound playing stops, if Editor/notepad.exe or Mame/mame.exe starts