TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

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 String Catalog.

SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!

Localize My App

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.