I.e. if a sound occurs at time T, how can we determine T during the
eventual AURenderCallbackStruct::inputProc() callback delivering that audio
data?

In Chrome we've always done this by roughly the following calculation:
T = inTimeStampReceivedByInputProc->mHostTime -
AudioUnitGetProperty(kAudioUnitProperty_Latency) -
 AudioObjectGetPropertyData(kAudioDevicePropertyLatency);

https://cs.chromium.org/chromium/src/media/audio/mac/audio_low_latency_input_mac.cc?l=1059

Is this actually correct? Specifically, I wonder if we really need to
manually include the two latency properties or if those are already baked
into the provided AudioTimeStamp?

Similarly, for output if we render a sound at time T, we expect it to play
at T = inTimeStampReceivedByInputProc->mHostTime +
AudioUnitGetProperty(kAudioUnitProperty_Latency) +
AudioObjectGetPropertyData(kAudioDevicePropertyLatency)

https://cs.chromium.org/chromium/src/media/audio/mac/audio_auhal_mac.cc?l=392

The playout case seems more reasonable to need to include the additional
latency fields, but again I can't find any documentation suggesting what is
actually correct. Thanks in advance for any clarity!

- dale
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to