How nhattruong0205/soundsanctuary works
SoundSanctuary is an offline-first bird-sound identifier with few-shot species enrollment and an optional shared review service. The main user workflow runs from microphone or file audio through windowing and on-device inference to species/soundscape results; Document Mode can add exemplars for later matching. A separate ML pipeline builds the model and reference library consumed by the app. Edges reflect shown calls or README-documented flows; unsampled internals are represented only where the README establishes their role.
Main entry points: App.tsx App shell · IdentifyView.tsx Identify mode · DocumentView.tsx Document mode · model.ts Inference client
Components 29
Offline web app
- App shell
app/src/App.tsx - Audio capture
app/src/lib/audio.ts - Identify mode
app/src/components/IdentifyView.tsx - Matching & priors
app/src/lib/identify.ts - Species library
app/src/lib/library.ts - Inference client
app/src/lib/model.ts - Model worker
app/src/lib/model.worker.ts - Audio visualizations
app/src/components/Spectrogram.tsx - Soundscape bars
app/src/components/SoundscapeBars.tsx - Document mode
app/src/components/DocumentView.tsx - Offline records
app/src/lib/db.ts - Library browser
app/src/components/LibraryView.tsx - Settings & sync
app/src/components/SettingsView.tsx - Review sync client
app/src/lib/sync.ts
Model pipeline
- Training data prep
ml/prepare.py - Data acquisition
ml/fetch_data.py - Student network
ml/model.py - Student training
ml/train_student.py - Quantized export
ml/export.py - Reference library build
ml/build_library.py - Model evaluation
ml/evaluate.py
Shared review
- Review API
server/app.py - Editor review page
server/review.html
Other components
- Listener
- Microphone / file
- ONNX model asset
app/public/models/sanctuary.onnx - Model library assets
app/public/models/library.json - BirdNET teacher
- Audio data sources
Connections 38
- Listener → App shell: uses
README.md - App shell → Species library: loads
app/src/App.tsx - App shell → Inference client: loads model
app/src/App.tsx - App shell → Identify mode: routes to
app/src/App.tsx - App shell → Document mode: routes to
app/src/App.tsx - App shell → Library browser: routes to
app/src/App.tsx - App shell → Settings & sync: routes to
app/src/App.tsx - Microphone / file → Audio capture: provides audio
app/src/lib/audio.ts - Audio capture → Identify mode: supplies windows
app/src/components/IdentifyView.tsx - Identify mode → Inference client: requests inference
app/src/components/IdentifyView.tsx - Identify mode → Matching & priors: analyses results
app/src/components/IdentifyView.tsx - Matching & priors → Species library: matches against
app/src/lib/identify.ts - Identify mode → Offline records: saves detections
app/src/components/IdentifyView.tsx - Identify mode → Audio visualizations: renders spectrogram
app/src/components/IdentifyView.tsx - Identify mode → Soundscape bars: renders scores
app/src/components/IdentifyView.tsx - Inference client → Model worker: dispatches jobs
app/src/lib/model.ts - Inference client → ONNX model asset: loads model
README.md - Species library → Model library assets: loads references
app/src/lib/library.ts - Species library → Offline records: reads user species
app/src/lib/library.ts - Document mode → Audio capture: captures clips
app/src/components/DocumentView.tsx - Document mode → Inference client: embeds calls
README.md - Document mode → Offline records: stores exemplars
app/src/components/DocumentView.tsx - Document mode → Audio visualizations: renders previews
app/src/components/DocumentView.tsx - Document mode → Review sync client: submits species
app/src/components/DocumentView.tsx - Library browser → Offline records: reads records
app/src/components/LibraryView.tsx - Settings & sync → Review sync client: starts sync
app/src/components/SettingsView.tsx - Review sync client → Review API: HTTP exchange
README.md - Editor review page → Review API: editorial review
README.md - Audio data sources → Data acquisition: provides recordings
README.md - Data acquisition → Training data prep: supplies datasets
README.md - Training data prep → Student training: prepares examples
README.md - BirdNET teacher → Student training: teacher targets
README.md - Student training → Student network: trains network
README.md - Student network → Quantized export: quantizes
README.md - Student network → Reference library build: embeds references
README.md - Reference library build → Model evaluation: evaluated with
README.md - Quantized export → ONNX model asset: writes model
README.md - Reference library build → Model library assets: writes library
README.md