AudioContext.outputLatency not supported in Safari: How do audiovisual apps handle bluetooth latency in Safari?

41 Views Asked by At

I am developing an audio/visual web app. In order to synchronize the visual and audio elements of my app, when users are using bluetooth headphones, I make use of the web audio api's AudioContext.baseLatency value to offset the visual elements to synchronize with the audio received by the user.

This works great in Chrome and firefox: but is not implemented in Safari. I'm just curious how other apps deal with this. For example, Youtube playback on safari while wearing bluetooth headphones is perfectly synchronized. How do web developers obtain the latency information needed to perform this synchronization in Safari?

I have tried using AudioContext.outputLatency, but to no avail, since it is not implemented in Safari. ChatGPT suggested somehow taking advantage of WebRTC to figure this out, but I can't see how that would work.

0

There are 0 best solutions below