Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Waky - Shower Alarm iOS App 🚿⏰

An innovative alarm app that forces you to wake up by requiring the sound of your running shower to dismiss the alarm.

Features

  • 🔔 Smart Alarms - Schedule one-time or repeating alarms with customizable sounds
  • 🚿 Shower Detection - Uses Core ML and SoundAnalysis to detect your shower running
  • 🎯 Can't Skip It - Alarm only stops when shower sound is confirmed
  • 😴 Limited Snooze - 3 snoozes max to prevent infinite delays
  • Beautiful UI - Dark mode with glassmorphism effects and smooth animations

Requirements

  • iOS 17.0+
  • Xcode 15.0+
  • macOS Ventura+ (for Create ML model training)
  • Apple Developer Account (for TestFlight distribution)

Project Structure

Waky/
├── Waky.xcodeproj/
├── Waky/
│   ├── WakyApp.swift              # App entry point
│   ├── ContentView.swift          # Main navigation
│   ├── Info.plist                 # Permissions
│   │
│   ├── Models/
│   │   ├── Alarm.swift            # Alarm data model
│   │   └── SoundClassification.swift   # Sound detection model
│   │
│   ├── ViewModels/
│   │   ├── AlarmViewModel.swift         # Alarm management
│   │   └── SoundDetectorViewModel.swift # Sound detection
│   │
│   ├── Views/
│   │   ├── HomeView.swift         # Main screen
│   │   ├── AlarmEditView.swift    # Create/edit alarm
│   │   ├── AlarmTriggerView.swift # Full-screen alarm UI
│   │   └── SettingsView.swift     # App settings
│   │
│   ├── Services/
│   │   ├── AudioCaptureService.swift     # Microphone capture
│   │   ├── SoundAnalysisService.swift    # ML classification
│   │   ├── AlarmSchedulerService.swift   # Notifications
│   │   └── AlarmPlayerService.swift      # Audio playback
│   │
│   ├── ML/
│   │   └── ShowerSoundClassifier.mlmodel # Trained model
│   │
│   └── Assets.xcassets/
│
└── TrainingData/
    ├── shower/                    # Shower sound recordings
    └── background/                # Background noise samples

Setup Instructions

1. Open in Xcode

Open Waky.xcodeproj on your Mac with Xcode 15+.

2. Train the Sound Classifier

  1. Record 10+ shower sound clips (5-10 seconds each) on your iPhone
  2. Record 10+ background noise clips (silence, talking, music, etc.)
  3. Transfer recordings to your Mac:
    • Place shower recordings in TrainingData/shower/
    • Place background noise in TrainingData/background/
  4. Open Create ML (comes with Xcode):
    • File → New → Sound Classification
    • Drag the TrainingData folder
    • Click "Train"
    • Export as ShowerSoundClassifier.mlmodel
  5. Drag the exported model into Waky/ML/

3. Configure Signing

  1. Select the Waky target in Xcode
  2. Set your Development Team
  3. Change Bundle Identifier to your own (e.g., com.yourname.waky)

4. Run on Device

Connect your iPhone and build (⌘+R). The app requires a real device for:

  • Microphone access
  • Sound classification
  • Notification testing

Usage

  1. Create an Alarm: Tap the + button, set time and repeat days
  2. When Alarm Triggers:
    • Full-screen UI appears
    • Alarm sound plays (gradually louder)
    • Turn on your shower
    • App listens and confirms shower sound
    • Alarm dismisses automatically!
  3. Snooze: Up to 3x 5-minute snoozes if needed

TestFlight Distribution

  1. Archive the app (Product → Archive)
  2. Distribute to App Store Connect
  3. Add testers in TestFlight section
  4. Testers receive invite link

Technical Details

Sound Classification

  • Uses SNAudioStreamAnalyzer with custom Core ML model
  • Requires 3 consecutive shower detections to confirm
  • Falls back to Apple's built-in classifier (water sounds) if no custom model

Alarm Reliability

  • Uses UNUserNotificationCenter with critical alerts
  • Background audio mode for continued sound playback
  • Audio processing mode for microphone access

Privacy

  • All audio processing happens on-device
  • No data is sent to external servers
  • Microphone is only active when alarm is triggered

Troubleshooting

Alarm doesn't sound in background?

  • Ensure "Background Modes" is enabled in Xcode capabilities
  • Check notification permissions in iOS Settings

Shower not detected?

  • Train the model with more samples
  • Test detection in Settings → Test Sound Detection
  • Ensure microphone permission is granted

Build errors?

  • Clean build folder (⌘+Shift+K)
  • Ensure iOS 17.0+ deployment target

License

MIT License - feel free to modify and use!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages