voximplant / react-native-voximplant

Voximplant mobile SDK for React Native (iOS/Android)
http://voximplant.com
205 stars 39 forks source link

Switch to loud speaker issue. #159

Open ketanb24 opened 2 years ago

ketanb24 commented 2 years ago

I implement video calling function there is an issue when call is connected sound come from ear speaker not from loud speaker anyone can help me to implement this features.

pe1ros commented 2 years ago

Hello @ketanb24 !

You can check realization main piece SDK API in ours React Native Voximplant Demo Projects.

You need to do something like that:

import {Voximplant} from 'react-native-voximplant';

const AudioDeviceManager =
    Voximplant.Hardware.AudioDeviceManager.getInstance();

const selectAudioDevice = async (device: string) => {
    // device equal one of these: 'Earpiece', 'Speaker', 'WiredHeadset', 'Bluetooth'
    await AudioDeviceManager.selectAudioDevice(device);
};