Skip to content

Repository files navigation

Dumbo

KotlinCompose MultiplatformAndroidiOSLicense

A real-time sound detection and alert app for people with hearing loss. Dumbo listens for dangerous sounds and alerts you through haptic vibration, a full-screen flash, and a local notification — so you never miss something important.


image

Demo

baby_cry_detectedbaby_cry_detectedcar_horn_detected

Why We Built This

People with hearing loss or deafness face a hidden danger that most people take for granted: they cannot hear warnings that others rely on instinctively — fire alarms, approaching emergency vehicles, a baby crying in the next room, breaking glass.

Existing solutions are either hardware-dependent (expensive smart home devices) or require constant screen attention. Dumbo runs entirely on your phone, requires no extra hardware, and alerts you through the senses you rely on most — touch and sight.

No cloud. No subscription. No personal audio data leaves your device.


What It Detects

SoundFlash ColorHaptic Pattern
SirenRedDouble pulse
Fire AlarmRedDouble pulse
Baby CryBlueLong soft vibration
Breaking GlassAmberShort sharp pulse
Car HornAmberShort sharp pulse

Sounds are classified at 70% confidence or higher to minimize false alerts.


How It Works

Microphone (16 kHz PCM)
|
v
Audio Chunks (100ms)
|
v
ML Classifier
┌─────────────────────────────────────────┐
│ Android: MediaPipe YAMNet (TFLite) │
│ iOS: Apple SoundAnalysis Framework │
└─────────────────────────────────────────┘
|
v
Confidence >= 70%?
|
v
Alert Layer
┌────────────────────────────────────────────────┐
│ Haptic → vibration pattern via OS feedback │
│ Visual → full-screen color flash (1.6s fade) │
│ Notify → local notification (works in bg) │
└────────────────────────────────────────────────┘

All inference runs on-device. Audio is processed in memory and never stored or transmitted.


Architecture

Dumbo is a Kotlin Multiplatform app with ~95% shared code. Platform-specific APIs (microphone, haptics, notifications, ML) are abstracted behind interfaces and injected via Koin.

commonMain
├── domain/ UseCase logic — ClassifySoundUseCase, AlertUseCase
├── platform/ Interface declarations — AudioCapture, AudioClassifier,
│ HapticFeedback, NotificationService, MicrophonePermission
├── viewmodel/ SoundDetectionViewModel — StateFlow<SoundDetectionState>
├── ui/ Compose screens, FlashOverlay, permission primers
└── di/ Koin modules — AppModule, PlatformModule (expect)
androidMain
├── platform/ AudioRecord, MediaPipe YAMNet, Vibrator, NotificationCompat
└── di/ PlatformModule.android.kt (actual)
iosMain
├── platform/ AVAudioEngine, SoundAnalysis, UIImpactFeedback, UNUserNotification
└── di/ PlatformModule.ios.kt (actual)

Data flow:

AudioCapture → ClassifySoundUseCase → SoundDetectionViewModel → AlertUseCase
(Flow) (Flow) (StateFlow) (haptic + flash + notify)

Tech Stack

ComponentTechnology
LanguageKotlin 2.3.0 (K2 compiler)
UICompose Multiplatform 1.10.0
DIKoin 4.1.0
Android MLMediaPipe Tasks Audio + YAMNet (TFLite)
iOS MLApple SoundAnalysis framework (built-in)
AsyncKotlin Coroutines + Flow
Min AndroidAPI 24 (Android 7.0)
Min iOSiOS 15

Getting Started

Prerequisites

  • Android Studio Meerkat or later
  • Xcode 15 or later (for iOS builds)
  • JDK 17
  • Kotlin Multiplatform plugin installed in Android Studio

Clone

git clone https://github.com/your-username/Dumbo.git
cd Dumbo

Android

  1. Open the project in Android Studio.
  2. Wait for Gradle sync to complete.
  3. Select the composeApp run configuration.
  4. Run on a physical device or emulator (API 24+).

Sound classification works best on a real device. Microphone input on emulators is limited.

iOS

  1. Build the shared framework from the project root:
    ./gradlew :composeApp:linkDebugFrameworkIosSimulatorArm64
  2. Open iosApp/iosApp.xcodeproj in Xcode.
  3. Select your simulator or device target.
  4. Build and run (Cmd+R).

For a physical iOS device, set your development team in Xcode under Signing & Capabilities.


Permissions

Dumbo requests permissions only when you need them — never on first launch.

PermissionPlatformWhen Asked
MicrophoneAndroid + iOSWhen you tap "Enable Microphone"
VibrationAndroidGranted automatically at install
NotificationsAndroid (API 33+)On the first sound detection
NotificationsiOSOn the first sound detection

If a permission is permanently denied, the app shows a banner with a direct link to your device settings. The app stays usable — it never blocks you behind a permission wall.


Project Structure

Dumbo/
├── composeApp/
│ └── src/
│ ├── commonMain/ Shared Kotlin code (UI, domain, DI)
│ ├── androidMain/ Android implementations + YAMNet model asset
│ └── iosMain/ iOS implementations
├── iosApp/ Xcode project (Swift entry point)
└── gradle/
└── libs.versions.toml Single source of truth for all dependency versions

Contributing

Contributions are welcome. Please open an issue first to discuss what you want to change before submitting a pull request.

Areas where help would be most valuable:

  • Adding new sound classes beyond the current five
  • iOS background audio session improvements
  • Accessibility improvements (larger flash area, screen reader support)
  • Localization

License

MIT License. See LICENSE for details.


Acknowledgements

About

A real-time on Device Sound Detection App that alerts on detecting dangerous Sounds

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages