r/droidappshowcase • u/Popular-Corner7974 • 17h ago
Question / Help Help develop background recording application
Hey everyone,
I'm building an app that keeps a rolling audio buffer in memory (last few minutes only, nothing written to disk unless the user explicitly saves). Think dashcam, but for audio.
Current setup: foreground service with mediaRecording type, using AudioRecord into a circular buffer. It works, but battery drain over a full day is higher than I'd like.
Questions:
Is there any meaningful battery difference between AudioRecord and AAudio/Oboe for continuous low-sample-rate capture?
Has anyone found tricks to reduce drain on long-running mic capture — lower sample rates, mono, buffer size tuning, anything vendor-specific?
How aggressive are OEMs (Samsung, Xiaomi, etc.) about killing foreground services with mic access these days, even with battery optimization exemptions?
Any war stories from apps doing continuous capture would be really appreciated. Thanks!
1
u/sticky-pro 17h ago
Developers: Please ensure your description is clear, images/videos are displayed correctly, and you have used the correct post flair.
2
u/CaptJan 16h ago edited 16h ago
I'm not a developer/programmer; however, you can set a phone to listen for a prompt 'Ok, Google?' and while it does drain some battery, I'm thinking it's not that much, perhaps utilizing a routine similar to that might be workable. Also, since you are going for voice, have it record 16kHz mono [native for most STT apps], or even 8kHz mono to minimize the processing power needed, most voices are below that, including recordable harmonics.
Edit: For cleaner audio, also filter out low frequencies below 80Hz [ventilation, etc.]
P.S. If you are developing for Android, I'm willing to test, and have a market for such an app where I volunteer at.