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

echoCancel doesn't work on Android #373

Closed
jaween opened this issue Jul 29, 2024 · 1 comment
Closed

echoCancel doesn't work on Android #373

jaween opened this issue Jul 29, 2024 · 1 comment
Labels
Android bug Something isn't working

Comments

@jaween
Copy link

jaween commented Jul 29, 2024

Package version
5.1.1

Environment

  • OS: Android13

Describe the bug
On Android with echoCancel enabled, the currently playing audio is still packed up in the recording stream, when it should not. This works on iOS, but not Android even though the pub.dev listing says it does work on Android. Here is the RecordConfig:

final stream = await _recorder.startStream(
  RecordConfig(
    encoder: AudioEncoder.pcm16bits,
    echoCancel: true,
  ),
);

Expected behavior
With echoCancel enabled, the currently playing audio should not be picked up in the recording stream.

Additional context
My use case is a voip app, the user needs to be able to hear the other person's audio, but the other person should not hear their own audio.

@jaween
Copy link
Author

jaween commented Aug 1, 2024

Without using using echoCancel on the Flutter side, I tried changing the AudioSource on the Android side from DEFAULT to VOICE_COMMUNICATION and it does seem to successfully enable echo cancelation:

val reader = try {
AudioRecord(
MediaRecorder.AudioSource.DEFAULT,
sampleRate,
channels,
audioFormat,
bufferSize
)

So maybe the issue is that AudioSource.DEFAULT don't support certain AudioEffects such as the AcousticEchoCanceler?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants