Hi,
I'm currently working on a project to make retro games more accessible for blind players.
The idea is to add audio feedback during gameplay using Lua scripts in BizHawk. For example, playing short sounds when the player hits a wall, interacts with objects, or when certain events happen in the game.
To do this, I tried triggering a WAV sound from Lua. My first attempt was to launch an external executable that plays the sound.
Example:
os.execute("D:\\bizhawk\\sounds\\audio.exe D:\\bizhawk\\sounds\\s_wall.wav")
However, when the sound triggers, the emulator freezes for about 2–3 seconds before the sound plays and the game resumes. It seems that launching the external process blocks the emulator.
I also tried other approaches, like launching the sound through cmd with "start", and even creating a persistent audio executable that stays running and receives commands to play sounds. Unfortunately, I still experienced freezes or unreliable behavior.
What I'm looking for is a way to play short sound cues during gameplay without interrupting or freezing the emulator.
So my questions are:
1. Is there any built-in way in BizHawk Lua to play audio?
2. Is there a recommended non-blocking method to trigger sounds from Lua?
3. Would writing a BizHawk external tool (C# plugin) be the correct approach for this?
This is specifically for accessibility purposes, to help blind players understand what is happening in the game.
Any suggestions or ideas would be greatly appreciated.
Thanks!