feat: ✨ Add audio effects support for Android recordings
Description
On Android, recordings made with this package often contain noticeable echo and background noise compared to iOS, which sounds clean for the same environment. The root cause is that Android capture always used the raw MIC source with no device audio processing, while iOS routes through a voice pipeline that suppresses noise and echo by default.
This PR gives Android recordings access to the same kind of device-level audio processing, all opt-in so existing behavior is unchanged.
- Adds a configurable Android audio input source (
AndroidAudioSource) so callers can route capture through the device voice pipeline (e.g.voiceCommunication) instead of the raw mic. - Adds opt-in noise suppression, acoustic echo cancellation, and automatic gain control, each attached only when the caller enables it and the device supports it.
- Effects fail safely: an unsupported or unavailable effect is skipped without aborting the recording, and audio effects are released when the recorder is released.
- Audio sources that require newer Android versions fall back to the default source on older devices instead of producing unusable audio.
- Fails loudly when a requested source/sample-rate/channel combination cannot initialize, instead of recording garbage PCM (loud noise).
- Updates the example app to demonstrate the recommended voice-recording configuration.
All new settings default to off / mic, so projects that do not opt in keep their current recording behavior. Note that automatic gain control alters captured amplitude and therefore the rendered waveform, so it is best avoided for music or level-sensitive recording.
Checklist
- [x] The title of my PR starts with a Conventional Commit prefix (
fix:,feat:,docs:etc). - [x] I have followed the Contributor Guide when preparing my PR.
- [ ] I have updated/added tests for ALL new/updated/fixed functionality.
- [x] I have updated/added relevant documentation in
docsand added dartdoc comments with///. - [x] I have updated/added relevant examples in
examplesordocs.
Breaking Change?
- [ ] Yes, this PR is a breaking change.
- [x] No, this PR is not a breaking change.
Related Issues
Closes #442 Closes #381