Is it possible to change the audio device for the call when using the Vapi web SDK? We have an issue where the audio stops working when a user changes their audio device (e.g. plugs in their headphones)
k
Kings_big💫
04/30/2025, 6:15 PM
Yes, you can handle audio device changes in the Vapi Web SDK by using navigator.mediaDevices.ondevicechange and updating the audio output with setSinkId() on the audio element to ensure seamless transitions.
h
Henry Black
04/30/2025, 6:19 PM
Awesome, thanks @Kings_big💫
Henry Black
04/30/2025, 6:49 PM
@Kings_big💫 do you know how I do the equivilent with the camera stream too? I don't see a video element to set the sinkId on
k
Kings_big💫
04/30/2025, 7:00 PM
Use Tavus’ Conversational Video Interface for video-enabled digital twins, and configure a element in your web application, the sinkId property to set the audio output device for the video stream and ensure the video content is streamed properly to the element..
h
Henry Black
04/30/2025, 7:08 PM
I can't introduce Tavus really so I need to find another way. Thanks for the pointers though