-
Notifications
You must be signed in to change notification settings - Fork 29
[WIP] Add configurable audio device ID for WebRTC on Android #31
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
[WIP] Add configurable audio device ID for WebRTC on Android #31
Conversation
global.RTCRtpTransceiver = RTCRtpTransceiver | ||
global.RTCRtpReceiver = RTCRtpReceiver | ||
global.RTCRtpSender = RTCRtpSender | ||
global.RTCErrorEvent = RTCErrorEvent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll undo all of the reformatting changes from my editor. sorry about that 😅
Log.d(TAG, "=========================================="); | ||
Log.d(TAG, "JONATHAN'S FORK: USING CUSTOM AUDIO DEVICE CODE"); | ||
Log.d(TAG, "=========================================="); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will delete this kind of thing after i know what i have works
@@ -64,6 +71,9 @@ | |||
public class WebRTCModule extends ReactContextBaseJavaModule { | |||
static final String TAG = WebRTCModule.class.getCanonicalName(); | |||
|
|||
// Define fork version constant - increment this when making changes to the fork | |||
public static final String FORK_VERSION = "fork-version-0"; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will delete this when i know my code works. sorry about that
… fork version to 1
|
Overview
This PR adds the ability to configure the audio device ID used by WebRTC on Android. Currently, the WebRTC implementation on React Native only reports a single hardcoded "audio-1" device regardless of what physical microphone is connected, making it difficult to work with multiple audio inputs or integrate with other audio libraries like Expo AV.
Changes
defaultAudioDeviceId
field toWebRTCModuleOptions
GetUserMediaImpl
to use this configurable ID throughout the audio device lifecyclegetUserMedia
JavaScript API
Use Cases
This PR helps solve several issues:
Testing
I've tested this with both built-in and external microphones on Android. The configurable ID effectively allows WebRTC to use the same microphone as other audio APIs by setting the appropriate device ID.
Related Issues
This addresses the common issue where WebRTC and other audio APIs (like Expo AV) can't use the same microphone device on Android.