I am programming an audio App using AudioUnit and AVAudioSession, and AVAudioSession is initialized as:
[[AVAudioSession sharedInstance] setCategory:audioSessionCategory withOptions:AVAudioSessionCategoryOptionAllowBluetoothA2DP | AVAudioSessionCategoryOptionMixWithOthers error:NULL];
When a Bluetooth headset is connected, I am able to get the output latency by "AVAudioSession.sharedInstance().outputLatency".
However, the value retrieved is still much smaller than the real Bluetooth audio latency.
Also, I found that such a latency is actually changing over time, sometimes, within 1 min, the latency can change from 193ms to 260ms.
I am wondering how can I query the accurate current Bluetooth audio output latency using API calls?
If not possible, is there any way to lock the output latency to a safe value using Bluetooth audio?
I do not care about the latency if it is measurable.
Retrieving data ...