Alarm
Fire alarm beep detection
Install / Use
/learn @pldubouilh/AlarmREADME
Fire Alarm Detector
Note: also works for water leak detector
Featuring:
- fire alarm audio signature detection using FFT and pattern matching
- exec' a custom script if the alarm is detected - example pagerduty & picture-snap-n-upload scripts provided
- an optional server to handle the uploaded pictures (with automatic https and basic auth)
Motivation
I wanted a local solution running on a Raspberry Pi Zero, and not constantly pushing data to a server, surely it's doable with simple FFTs and pattern matching !
Optionally, being able to alert with pagerduty, or take pictures when the alarm is detected (server code included).
Usage
$ cd detect
$ go mod tidy
$ go build
$ ./detect --help
Usage of ./detect:
-beeps int
How many beeps to alert (default 3)
-device string
Target device. If empty, will list devices.
-duration duration
Duration of a beep (default 400ms)
-frequency int
Target frequency in Hz (default 3500)
-script string
Script to exec when an alarm is detected
-threshold string
Audio target threshold (default "7")
$ ./detect -device="Logitech StreamCam: USB Audio (hw:1,0)"
[play alarm.wav]
2024-04-07 13:41:47 -- alarm detected!
Feel free to explore the codebase, this is more of a glorified (but fuctioning !) script :).
A pre-compiled binary for Raspberry Pi is provided in the release section. It only has a dependency on portaudio19-dev.
The two scripts have dependencies on curl, and ffmpeg for the picture uploading script.
Related Skills
node-connect
352.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。

