A simple Lua script which plays a .wav sound whenever specified keybind was activated.
Originally script was specified only for Replay Buffer save event and it works not on Save button press, but when replay was saved in file. So there was delay between press and sound effect.
Now you can launch sound not on event, but on keybind, which solves delay problem.
-
Download script and change PROP_AUDIO_FILEPATH to a path to the sound of your choosing. By default it's Windows Hardware Remove sfx
-
Launch OBS -> Tools -> Scripts -> +
This Lua script was downloaded from https://gist.github.com/DareFox/fd91bab3b8b5f26601f5e47ae2cf9f07
Credits:
- snakecase (https://gist.github.com/snakecase/e816384a071cec31efbb4b9e429c108d)
- upgradeQ (https://gist.github.com/upgradeQ/b2412242d76790d7618d6b0996c4562f),
- gima (https://gitlab.com/gima/obsnotification)
Thank you guys!
hey there. thanks for getting back to me. I see the script is loading and unloading in the log. If I mistype the path to the sound file it gives me:
[Lua: onKeybindSound.lua] Error loading file: R:/Videos/OBS/onKeybindSound.lua:7: invalid escape sequence near '"R:\Videos\OBS'
And when it's typed correctly, I see it load fine in the log, but when I hit the keybind, nothing shows up in the log other than the saving of the buffer:
[ffmpeg muxer: 'Replay Buffer'] Wrote replay buffer to 'R:/Replay 2022-11-30 23-10-12.mkv'
There's no mention of onKeybindSound.lua anywhere else in the log other than load an unload. I double checked to make sure the file was good, and tried a couple other wavs too, no luck.