callObject.setAudioDevice() is not working before joining a call

Options
Karthik
Karthik Member
edited October 2023 in Discussion

Hi,
I am developing a Haircheck feature for the mobile app using react-native. Inside Haircheck(before joining the call), I am trying to change the audio device but the callObject.setAudioDevice() method is not working.

Flow:
1. Connected BLUETOOTH earphones to the mobile.
2. Open the app and go to haircheck(view before joining the call).
3. Run callObject.startCamera() method.
4. The default shown audio device is Bluetooth earphones.
5. Change the Audio device to "SPEAKERPHONE" or "WIRED_OR_EARPIECE" using callObject.setAudioDevice().
6. This change in the audio device is not reflected and the code {"callObject.setAudioDevice("SPEAKERPHONE")" } returns object {"deviceId": "BLUETOOTH"}
7. Also callObject?.getInputDevices() returns.

{"camera": {"deviceId": "com.apple……video:1", "facing": "user", "groupId": "", "kind": "videoinput", "label": "Front Camera"}, "mic": {"deviceId": "BLUETOOTH", "groupId": "", "kind": "audio", "label": "Bluetooth"}, "speaker": {"deviceId": "BLUETOOTH", "groupId": "", "kind": "audio", "label": "Bluetooth"}}


8. So, the default audio device is still "BLUETOOTH".

This issue only happens before joining the call. But After Joining the call, using callObject.join() method, there is no issue, and callObject.setAudioDevice() is working properly.


Currently using:
"@daily-co/react-native-daily-js": "^0.46.0",
"react-native": "0.71.6",

Mobile devices used:
1. IOS version 16.6.1 (iPhone 13).
2. Android 10 (one plus 5).