Reputation: 337
I'm getting device from useAudioOutputs() hook that is provider by amazon-chime-sdk-component-library-react and its populating the device but when i pass the deviceId to function chooseAudioOutput it ain't changing device
"amazon-chime-sdk-component-library-react": "^3.7.0", "amazon-chime-sdk-js": "^3.18.2",
try {
const selectedAudioOutputDeviceInfo = audioOutputs.find(
(device: any) => device?.deviceId === deviceId?.value,
)
const selectedDeviceId = selectedAudioOutputDeviceInfo?.deviceId
console.log('selected sound', selectedAudioOutputDeviceInfo?.deviceId)
await meetingSession.audioVideo.chooseAudioOutput(selectedDeviceId)
} catch (error) {
console.log('error in changing speaker', error)
}
Upvotes: 0
Views: 93