Skip to content

Commit

Permalink
Use audio source VOICE_COMMUNICATION for echo cancelling (livekit#351)
Browse files Browse the repository at this point in the history
* Use audio source VOICE_COMMUNICATION for echo cancelling

* Spotless
  • Loading branch information
davidliu authored Jan 7, 2024
1 parent c6646c3 commit 28c2474
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 LiveKit, Inc.
* Copyright 2023-2024 LiveKit, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -164,7 +164,8 @@ object RTCModule {
.setAudioTrackErrorCallback(audioTrackErrorCallback)
.setAudioRecordStateCallback(audioRecordStateCallback)
.setAudioTrackStateCallback(audioTrackStateCallback)
.setAudioSource(MediaRecorder.AudioSource.DEFAULT)
// VOICE_COMMUNICATION needs to be used for echo cancelling.
.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION)
.setAudioAttributes(audioOutputAttributes)

moduleCustomizer?.invoke(builder)
Expand Down

0 comments on commit 28c2474

Please sign in to comment.