Fire alarm audio detection, utilizing FFTs and Go

Fire alarm audio detection, utilizing FFTs and Go

fire fire fire

Note: additionally works for water leak detector

Featuring:

  • fireplace alarm audio signature detection utilizing FFT and sample matching
  • exec’ a customized script if alarm detected – pagerduty & picture-upload scripts
  • an non-compulsory server to deal with the uploaded footage (with https and fundamental auth)

I wished a neighborhood answer operating on a Raspberry Pi Zero, and not consistently pushing information to a server, absolutely it is doable with easy FFTs and sample matching !

Optionally, having the ability to alert with pagerduty, or take footage when the alarm is detected (server code included).

$ cd detect
$ go mod tidy
$ go construct
$ ./detect --help
Usage of ./detect:
 -device string
 goal machine. If empty, will checklist gadgets.
 -script string
 script to exec when an alarm is detected
 -threshold string
 audio goal 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 discover the codebase, that is extra of a glorified (however fuctioning !) script :).

A pre-compiled binary for Raspberry Pi is supplied on the discharge part. It solely has a dependency on portaudio19-dev.
The two scripts have dependencies on curl, and ffmpeg for the image importing script.

HI-FI News

through Hacker News https://ift.tt/CcGt4dn

April 7, 2024 at 08:45PM