Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add audioManagerMode and setSpeakerphoneOn support in record_android to fix Echo Cancellation on Samsung S20 #454

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

keyur2maru
Copy link

Description

  • Bumped record_android to version 1.3.1.
  • Features:
    • Added audioManagerMode to configure AudioManager modes to fix echo cancellation issues on some Android devices (verified on Samsung S20).
    • Added setSpeakerphoneOn option to enable speakerphone, addressing echo issues and external playback needs.
  • Updated pubspec.yaml to reference record_android version 1.3.1.
  • Updated AndroidRecordConfig in Dart to support the new options.

These changes enhance recording capabilities by improving echo cancellation compatibility across devices, with specific testing on the Samsung S20.

…ing speakerphone

- Introduced `audioManagerMode` in `MethodCallHandlerImpl` to map configuration values to `AudioManager` modes.
- Updated `RecordConfig` to include new parameters:
  - `audioManagerMode` (default: `MODE_NORMAL`).
  - `setSpeakerphoneOn` (default: `false`).
- Modified `AudioRecorder` to:
  - Configure `AudioManager` mode during initialization if `audioManagerMode` is specified.
  - Enable speakerphone if `setSpeakerphoneOn` is `true`.
- Updated Dart `AndroidRecordConfig`:
  - Added `audioManagerMode` with an enum for supported modes.
  - Added `setSpeakerphoneOn` for controlling speakerphone behavior.
  - Updated `toMap` method to serialize new properties.

Reason for changes:
- Switching `AudioManager` modes (e.g., to `MODE_IN_COMMUNICATION`) helps address acoustic echo cancellation issues, particularly on devices like the Samsung S20.
- Enabling the speakerphone is useful for scenarios where external playback is needed or for devices with echo issues in recording.
- These additions provide greater flexibility for managing audio configurations, improving compatibility across a broader range of devices.

Signed-off-by: Keyur Maru <[email protected]>
- Updated `record_android` to v1.3.1 in `pubspec.yaml`.
- Includes support for `audioManagerMode` and `setSpeakerphoneOn` for improved echo cancellation and external playback scenarios.

Signed-off-by: Keyur Maru <[email protected]>
@keyur2maru keyur2maru changed the title Add audioManagerMode and setSpeakerphoneOn support in record_android Add audioManagerMode and setSpeakerphoneOn support in record_android to fix Echo Cancellation on Samsung S20 Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant