Skip to content
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

Switch to loud speaker issue. #159

Open
ketanb24 opened this issue May 2, 2022 · 3 comments
Open

Switch to loud speaker issue. #159

ketanb24 opened this issue May 2, 2022 · 3 comments

Comments

@ketanb24
Copy link

ketanb24 commented May 2, 2022

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
Copy link
Contributor

pe1ros commented May 4, 2022

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);
};

@Bayramito
Copy link

Bayramito commented Oct 2, 2024

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);
};

IOS
{"_onDeviceChanged": [Function anonymous], "_onDeviceListChanged": [Function anonymous], "listeners": {"DeviceListChanged": Set {[Function anonymous]}}}
ANDROID
This approach does not work on Android.. Since listeners object is coming empty
{"_onDeviceChanged": [Function anonymous], "_onDeviceListChanged": [Function anonymous], "listeners": {}}

@YuliaGrigorieva
Copy link
Contributor

@Bayramito

AudioDeviceManager.selectAudioDevice API does not return the promise.

If the selected audio device is set successfully, SDK invokes the DeviceChanged event.

Best regards,
Yulia Grigorieva

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants