Repository navigation
feat: opt-in microphone snore detection that keeps only snore times - #74
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 18 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…es, never audio Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Wac1uHSpomCEBtwBdw1YA Signed-off-by: Jonathan Ng <jon@jonathanng.com>
…essions, block double starts, keep sessions out of backups, restart only on input changes Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Wac1uHSpomCEBtwBdw1YA Signed-off-by: Jonathan Ng <jon@jonathanng.com>
…cking on CI Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Wac1uHSpomCEBtwBdw1YA Signed-off-by: Jonathan Ng <jon@jonathanng.com>
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Opt-in overnight snore detection with the iPhone microphone. It implements section 2 of sleepypod/training's overnight capture plan. Find it under Settings → Health → Snore detection (Beta).
AVAudioSessionin therecordcategory, with theaudiobackground mode added toInfo.plist. AnAVAudioEngineinput tap feeds Apple's built-in classifier (SNClassifySoundRequest(.version1)throughSNAudioStreamAnalyzer, 3 s windows, 0.5 overlap). Capture refuses to start when the classifier'sknownClassificationshas nosnoringlabel.Application Support/Snore/snore-<captureId>.json. Raw audio, transcripts and embeddings are never written or sent. Nothing uploads automatically; the screen exports the session through the share sheet.docs/snore-capture.mddocuments it, with events in the training contract fields (captureId,startMs,endMs,eventType,confidence,detectorVersion,labelOrigin).project.ymlis unchanged.Info.plistgets onlyNSMicrophoneUsageDescriptionand theaudiobackground mode.Test plan
xcodebuild build -scheme Sleepypod -destination generic/platform=iOS SWIFT_TREAT_WARNINGS_AS_ERRORS=YES(CI build)xcodebuild test -only-testing:SleepypodTestson an iOS 26 simulator. The new suites cover:SnoreDetection.swift99.4%;SnoreCaptureService.swift93.3%;SnoreAudioCapture.swift8%, the hardware-bound engine and classifier glue;SnoreCaptureView.swiftUI, untested, as other views here.swiftlint --strictLimitations
🤖 Generated with Claude Code
https://claude.ai/code/session_016Wac1uHSpomCEBtwBdw1YA