react-native-webrtc / react-native-incall-manager

Handling media-routes/sensors/events during a audio/video chat on React Native
ISC License
547 stars 191 forks source link

How to route to the main phone speaker? #244

Closed kross-italk closed 4 months ago

kross-italk commented 4 months ago

Like #230 . The documentation nor the issue tracker isn't in the best state to help resolve these questions myself. How am I expected to utilize chooseAudioRoute to move audio to the main speaker instead of the earpiece?

  1. chooseAudioRoute isn't documented on the public README. I just found it in the code, but it is public
  2. chooseAudioRoute with input of "SPEAKER_PHONE" doesn't move the audio (In the result promise, selectedDevice is stil "" or null).
  3. chooseAudioRoute with input of "EARPIECE" shows selectedDevice is now earpiece, but that was the default behavior. How do I move the audio to the main speaker?

I have tried #230 and deferred initialization until after a call is started. No effect. I have tried all the suggestions from #146 (setForceSpeakerphoneOn). No effect.

Please improve your community facing documentation if there are resolutions to these issues.

kross-italk commented 4 months ago

Jipes, bitten by yet another permissions issue. Solution is here: https://react-native-webrtc.discourse.group/t/cant-use-speaker-just-earpiece/1509

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />