Smart sleep-aid app that plays ambient sounds and auto-fades volume as you fall asleep
Pick a sound, press play, fall asleep — Slumbr detects your sleep and gently fades the volume to silence. No timers to set, no manual adjustments. Just sleep.
- 19 Curated Sounds — Hand-picked ambient sounds across 4 categories
- Sleep Detection — Microphone-based monitoring detects when you fall asleep
- Smooth Volume Fade — Continuous linear interpolation, not jarring step changes
- Live Switching — Change sounds mid-session without restarting detection
- Sleep Summary — Duration, stage breakdown, and timeline when you stop
- Categorized Browser — Expandable categories: Rain, Nature, Noise, Other
- Zero Config — No account, no cloud, no timers to set — just press play
┌─────────────┐ audio_streamer ┌─────────────┐ Volume ┌─────────────┐
│ Microphone │───────────────►│ Silero VAD │────────────►│ Fade │
│ (PCM 16k) │ Float→PCM16 │ Voice Det. │ Factor │ Volume │
└─────────────┘ └─────────────┘ (linear) └─────────────┘
- Pick a sound from 4 categories and tap Start
- Audio plays immediately while Silero VAD loads in background
- Microphone captures audio via
audio_streamer, fed into Silero VAD model - VAD distinguishes human voice from speaker playback in real-time
- As silence duration increases, sleep stages progress:
| Quiet Duration | Stage | Volume | Behavior |
|---|---|---|---|
| 0 – 10 min | Awake | 100% | Full volume |
| 10 – 30 min | Falling Asleep | 100% → 64% | Gradual fade |
| 30 – 60 min | Light Sleep | 64% → 10% | Continues fading |
| 60+ min | Deep Sleep | 10% | Fades to silence, stops |
- If voice is detected, volume smoothly ramps back up (5-second fade)
- On stop, a Sleep Summary dialog shows stage timeline chart and duration breakdown
| Category | Sounds |
|---|---|
| 🌧 Rain | Heavy Rain, Light Rain, Rain on Window, Rain on Tent, Thunder |
| 🌿 Nature | Campfire, River, Waterfall, Waves, Wind in Trees, Jungle, Crickets |
| 🔊 Noise | Brown Noise, Pink Noise, White Noise |
| ✨ Other | Cat Purring, Singing Bowl, Inside a Train, Underwater |
- Flutter SDK >= 3.11
- Android SDK (compileSdk 36) or Xcode for iOS
- Java 17
# Clone
git clone https://github.com/SnowWarri0r/slumbr.git
cd slumbr
# Install dependencies
flutter pub get
# Run on connected device
flutter run# Android APK
flutter build apk --release
# iOS (requires macOS + Xcode)
flutter build ios --release| Layer | Technology |
|---|---|
| Framework | Flutter + Material Design |
| Audio Playback | just_audio (looping, volume control) |
| Microphone | audio_streamer (raw PCM capture) |
| Voice Detection | vad (Silero VAD model) |
| Background | flutter_foreground_task (screen-off operation) |
| Charts | fl_chart (sleep timeline) |
| Permissions | permission_handler |
| i18n | Custom lightweight (en/zh) |
lib/
main.dart # App entry, MaterialApp with i18n config
home_page.dart # Main UI — sound picker, playback, volume fade, summary chart
sleep_detector.dart # audio_streamer + Silero VAD, stage detection, foreground service
assets/audio/
rain/ # 5 rain & storm sounds
nature/ # 7 nature & wildlife sounds
noise/ # 3 colored noise variants
other/ # 4 unique ambient sounds
| Workflow | Trigger | Action |
|---|---|---|
| CI | Push / PR to main |
flutter analyze |
| Release | Push v* tag |
Build APK → GitHub Release |
# Create a release
git tag v1.0.0
git push origin v1.0.0
# → GitHub Actions builds APK and publishes release automaticallyAmbient sounds sourced from Moodist (MIT License).
Issues and PRs are welcome! Feel free to open an issue for bug reports or feature requests.
If this project helps you sleep better, consider giving it a ⭐