GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>

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 try! Swift Tokyo.

SPONSORED Ready to dive into the world of Swift? try! Swift Tokyo is the premier iOS developer conference will be happened in April 9th-11th, where you can learn from industry experts, connect with fellow developers, and explore the latest in Swift and iOS development. Don’t miss out on this opportunity to level up your skills and be part of the Swift community!

Get your ticket here

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.