Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
OBS Lua: Sound notification on replay buffer save [Windows]
A simple Lua script which plays a .wav sound whenever replay buffer is saved.
## Installation
1. Download Half-Life 2 City Scanner NPC's camera shutter sound:
Use any .wav sound but make sure to match its name either in "Beep on replay buffer save.lua" (edit with any text editor) or rename your .wav file to "sound_npc_scanner_scanner_photo1.wav".
2. Put it in the same location with "Beep on replay buffer save.lua".
A good way is to create a separate "scripts" folder in %AppData%\obs-studio\ and keep all your scripts there in case you need to backup your OBS Settings.
3. OBS -> Tools -> Scripts -> +
This Lua script was downloaded from
Credits: upgradeQ (, gima (
Thank you guys!
local obs = obslua
local ffi = require("ffi")
local winmm = ffi.load("Winmm")
-- Put a sound of your choosing next to "Beep on replay save.lua" and don't forget to match its name either in code below or rename your file.
PROP_AUDIO_FILEPATH = script_path() .. "sound_npc_scanner_scanner_photo1.wav"
bool PlaySound(const char *pszSound, void *hmod, uint32_t fdwSound);
function playsound(filepath)
winmm.PlaySound(filepath, nil, 0x00020003)
function on_event(event)
then playsound(PROP_AUDIO_FILEPATH)
function script_load(settings)
-- This Lua script was downloaded from
-- Credits: upgradeQ (, gima (
-- Thank you guys!
Copy link

Worked great! Although the revised -10db sound is still just a tad too loud, so here's a revised quieter version of that revision (-15db in total, I think). Other than that, the script worked flawless :)

(attached it as .mp4 because non-authors can't send .mp3 for some reason. just make sure to rename it to .wav)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment