I did something similar for finding which outlet a breaker went to. I connected my MacBook to the outlet, airplay to the TV so it was loud, then had it yell if the power was disconnected:
while ! pmset -g batt | grep 'discharging'; do; echo waiting; sleep 1; done; say disconnected
a billion years ago I piped say and some various noise files into ffmpeg to make audios that sounded like numbers stations, I don't think it would run anymore but it was a lot of fun :D
Back in windows and powershell days, this was my favorite "security reminder" prank. Everyone who forgot to lock their machine and walked away got this script executed on their machines.
TLDR: it schedules a task "Security Reminder" to play "I'm watching you" via voice synth, every 30 mins.