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

[Android] Low microphone quality through Bluetooth audio #431

Open
Zazo032 opened this issue Nov 6, 2024 · 5 comments
Open

[Android] Low microphone quality through Bluetooth audio #431

Zazo032 opened this issue Nov 6, 2024 · 5 comments

Comments

@Zazo032
Copy link

Zazo032 commented Nov 6, 2024

Package version

5.2.0 and 5.1.2

Environment

  • OS: Android (14)
  • Flutter: 3.22.3

Describe the bug

When performing an audio recording with a Galaxy device (I couldn't test other brands but this is reproducible in different Galaxy models) with a Bluetooth headset connected (I used AirPods Pro for testing but we have reports of other standard Bluetooth devices), the audio quality of the recordings is bad. The audio seems to be recorded through Bluetooth SCO and there's no way to do it through A2DP, so all audio recorded through Bluetooth devices has a low audio quality. I tried setting manageBluetooth to false but then the audio is recorded through the device microphone and not through the Bluetooth one. Setting numChannels to 1, useLegacy to true or modifying the audioSource also doesn't seem to have any effect in the recording quality.

Record configuration

const RecordConfig()

Steps to reproduce

Steps to reproduce the behavior:

  1. Run example project on an Android device (only tested it in Galaxy devices)
  2. Connect a Bluetooth headset that supports "Calls" audio profile/channel (screenshot attached)
  3. Record and play some audio through the Bluetooth device (input and output).
Bluetooth device settings

Screenshot_20241106_154228_Settings

Expected behavior

Audio gets recorded with the same or similar audio quality to the native recorder app.

Actual behavior

Audio gets recorded with a significantly worse quality than expected when recording through a Bluetooth microphone.

Additional context

Disabling the "Calls" option in the Bluetooth device settings is a workaround to get the expected audio recording quality.

@llfbandit
Copy link
Owner

llfbandit commented Nov 6, 2024

Thanks for the report.
What if you try to set the device? There's no automatic selection of the device but with manageBluetooth SCO flag.

@Zazo032
Copy link
Author

Zazo032 commented Nov 6, 2024

Thanks for the report. What if you try to set the device? There's no automatic selection of the device but with manageBluetooth SCO flag.

Do you mean through RecordConfig.device? There doesn't seem to be a way to retrieve an InputDevice from Android to pass it to that parameter

@llfbandit
Copy link
Owner

listInputDevices()

@Zazo032
Copy link
Author

Zazo032 commented Nov 6, 2024

listInputDevices() is documented as returning an empty list in Android: https://pub.dev/documentation/record/latest/record/AudioRecorder/listInputDevices.html

I know the id and label from the device I'm using through a different plugin (mic_info), I tried with the following configuration but the recorded audio quality is still the same:

const RecordConfig(
  device: InputDevice(id: '309', label: 'AirPods Pro de Cristian'),
  androidConfig: AndroidRecordConfig(
    manageBluetooth: false,
  ),
),

llfbandit added a commit that referenced this issue Nov 6, 2024
@Zazo032
Copy link
Author

Zazo032 commented Nov 7, 2024

I just tried with listInputDevices() by hardcoding the object from the list that corresponds to the Bluetooth device with manageBluetooth: false, but the issue still persists

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

No branches or pull requests

2 participants