UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Bluetooth Audio Lag

Forums > Swift

How can I detect actual realtime latency lag between iOS Swift app and a bluetooth audio device?

Scenario

I'm working on an app with bi-directional audio (i.e. playing audio and recording audio to later be layered over the original - think karaoke). I've got the session set so it is handling bi-directional w/ adequate quality, but the recorded audio is typically behind up to 500ms so getting them in synch is not happening.

Not sure the best approach, as latency can change for a variety of reasons in realtime. Maybe is there a way to "ping" the headset periodically in order to get a 'current' latency and adjust my offset accordingly?

Apps like TikTok are handling this, so it must be solvable, but every search I do tells me how to correct delay on my device within the XYX app...which is not what I need. I need to build a solution in code.

If this isn't a good forum for this, any suggestions on where to look would be appreciated as well.

Happy Swifting.... :-)

audio #bluetooth #ios #swift

2      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.