This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass
What I Built
TrailWhisper is an offline bioacoustic audio guide designed to get hikers, birdwatchers, and nature walkers off their screens and into the wild.
Most nature identification apps pull you into your phone: you stop on the trail, wake the screen, open an app, snap a photo, and read long text entries. TrailWhisper turns that paradigm inside out. It runs continuously in the background on edge hardware (a phone via Termux or a laptop in your pack), capturing ambient audio buffers with an open-source acoustic classifier.
When an active bird call is detected with high confidence, TrailWhisper uses a local, quantized language model to construct a 1-sentence behavioral cue and whispers it directly into your bone-conduction headphones via offline neural TTS (e.g., "Wood Thrush β canopy left, courtship song").
Your eyes stay fixed on the canopy, your hands stay free, and total trail screen-time drops to under a minute per hike.
Code
The project source, ONNX export workflows, and mock test fixtures are open-source on GitHub:
TrailWhisper πΏπ¦
TrailWhisper is a completely offline, real-time bioacoustic listener loop designed for field naturalists, birders, and edge acoustic monitoring. Running entirely locally on consumer hardware without internet connectivity or external cloud APIs, TrailWhisper continuously listens for avian vocalizations, identifies species, crafts concise behavioral cues via an on-device Small Language Model (SLM), and whispers the observation into your ear in real time.
Architecture Overview
+------------------------------------+
| Default Audio Input (Microphone) |
+-----------------+------------------+
| (48,000 Hz Mono Stream)
v
+------------------------------------+
| audio_listener.py: AudioListener |
| (Thread-Safe 10s Rolling Buffer) |
+-----------------+------------------+
| Latest 3s-10s Window
v
+------------------------------------+
| classifier.py: Bioacoustic ONNX |
| (BirdNET V2.4 / V2.5 ONNX) |
+-----------------+------------------+
| Species & Confidence
v
[ Confidence > 0.75 ? ]
/ \
No / \ Yes
v v
(Continue) +------------------------------------+
| cue_generator.py: SmolLM2-1.7B GGUF|
| (Strict 1-sentence, < 12 words) |
+-----------------+------------------+
| Synthesized Cue Text
v
+------------------------------------+
| tts_player.py:β¦How I Built It
TrailWhisper runs entirely without internet access using a lightweight pipeline built on open-weight models and local runtimes:
-
Audio Perception: A converted BirdNET bioacoustic classification model compiled to ONNX Runtime, processing rolling 10-second mel-spectrogram buffers via
sounddevicewith minimal CPU overhead. -
Context & Whisper Generation: SmolLM2-1.7B-Instruct (Q4_K_M) orchestrated locally via
llama-cpp-python. It takes the detected species, rough time of day, and season to produce a concise 8-to-12 word natural-language cue describing location and song type. - Audio Synthesis: Piper TTS, an open-source neural text-to-speech engine running directly on the CPU, converting text to audio in under 80 milliseconds.
-
Agent Scaffold: Built with Python
asyncioto decouple the continuous audio ingest loop from inference and speech output.
Why Does Open Innovation Matter?
Building for the outdoors exposes the immediate failure modes of closed-source, cloud-dependent AI:
- True Offline Autonomy: Deep ravines, state parks, and mountain trails routinely have zero cellular service. Proprietary APIs fail the moment you lose signal; open weights run 100% locally on device.
- Real-Time Latency: Cloud API round trips add multiple seconds of network delay. By the time a cloud service transcribes, routes, and answers, the bird has flown away. Local inference achieves sub-second detection-to-ear latency.
- Zero Cost & Zero Data Leakage: Leaving a streaming cloud audio pipeline running over a 4-hour hike would rack up massive API fees and drain device batteries via constant 5G radio broadcast. TrailWhisper runs on an airplane-mode device for $0.00 forever, with no environmental audio ever leaving local memory.
My Agent Session
I built and scaffolded TrailWhisper using the Antigravity CLI and tracked the implementation, quantization checks, and dry-run tests with DevRelay:
Top comments (1)
tr.ee/dev-to