https://github.com/pldubouilh/alarm Skip to content Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} pldubouilh / alarm Public * Notifications * Fork 0 * Star 28 * Fire alarm beep detection License MIT license 28 stars 0 forks Branches Tags Activity Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights pldubouilh/alarm This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Name Name Last commit message Last commit date Latest commit History 2 Commits detect detect scripts scripts server server .gitignore .gitignore LICENSE LICENSE readme.md readme.md View all files Repository files navigation * README * MIT license Fire Alarm Detector fire fire fire Note: also works for water leak detector Featuring: * fire alarm audio signature detection using FFT and pattern matching * exec' a custom script if alarm detected - pagerduty & picture-upload scripts * an optional server to handle the uploaded pictures (with 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 on 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. About Fire alarm beep detection Resources Readme License MIT license Activity Stars 28 stars Watchers 1 watching Forks 0 forks Report repository Releases 1 first Latest Apr 7, 2024 Packages 0 No packages published Languages * Go 81.3% * Shell 13.5% * Makefile 5.2% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.