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 Superwall

SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.

Learn More

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.