feat: Biking-aware audio enhancement via Core Motion#103
feat: Biking-aware audio enhancement via Core Motion#103devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Add MotionActivityManager: monitors CMMotionActivityManager for cycling/automotive activity, exposes isBiking flag with notification - When biking detected, auto-switch AVAudioSession to .voiceChat mode (enables Apple's noise suppression, echo cancellation, AGC) - Insert AVAudioUnitEQ high-pass filter at 200 Hz into AVAudioEngine graph during streaming STT to cut wind rumble - Add NSMotionUsageDescription to Info.plist for Core Motion permission - Graceful fallback: if Core Motion unavailable or denied, audio pipeline behaves identically to before Co-Authored-By: bot_apk <apk@cognition.ai>
Original prompt from API User
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary
When Core Motion detects the user is cycling or in automotive motion, the voice recording pipeline automatically improves capture quality to cut through wind noise:
New file:
SpeechPipeline/MotionActivityManager— singleton that wrapsCMMotionActivityManager, filters for medium/high confidence cycling/automotive activity, and exposes a reactiveisBikingflag +Notification.Name.motionBikingStateDidChange. Bootstrapped fromAppDelegate.didFinishLaunching. Graceful no-op if Core Motion is unavailable or permission denied —isBikingstaysfalseand the audio pipeline behaves identically to before.Audio session voice isolation — both recording paths in
MessageBox(startRecordingAVAudioRecorder path andbeginStreamingRecordingAVAudioEngine/Deepgram path) now checkMotionActivityManager.shared.isBikingwhen configuringAVAudioSession:.voiceChatenables Apple's built-in echo cancellation + noise suppression + AGC.High-pass wind filter — in the streaming STT (AVAudioEngine) path, when biking is detected an
AVAudioUnitEQnode configured as a 200 Hz high-pass filter is inserted betweeninputNodeandmainMixerNode. The tap reads from the EQ's output so captured audio is already filtered before reaching Deepgram. The EQ is detached on teardown. No filter is applied when stationary.Info.plist — added
NSMotionUsageDescriptionfor the Core Motion permission prompt.Link to Devin session: https://app.devin.ai/sessions/d7cfd1e15cbe426387e3f22a9b053796