Thank you for helping me clear this up.  I measured by comparing mHostTime
with mach_absolute_time() - IOBufferDuration - outputLatency.  I'm using a
RenderNotify on the remoteIO on iOS. I'm seeing one timeStamp that is used
for both input and output callback buffers, and that time stamp is set to
about (IOBufferDuration + outputLatency) in the future.  How can a future
time stamp represent a buffer of samples from the microphone that has
already been captured.

renderCallback(){

    ViewController *self = (__bridge ViewController *)inRefCon;

    SInt64 ticksDiff = inTimeStamp->mHostTime - mach_absolute_time();
    float secsDiff = (ticksDiff * ticksToSeconds()) -
self->ioBufferDuration - self->outputLatency;
    printf("secs %f\n",secsDiff);

    return noErr;
}


Thanks for the help

On Sat, Apr 11, 2015 at 5:31 PM, Dan Klingler <[email protected]> wrote:

> >  I have measured the relationship between mHostTime and mSampleTime (on
> iOS), and it appears that for a timestamp in the render callback mHostTime
> represents the machine time of the last sample in the callback.
>
>
> How did you measure this?
>
> From the HAL’s perspective:
> mHostTime for output represents the time at which the device will consume
> the first sample in the callback buffer.
> mHostTime for input represents the time at which the device produced the
> first sample in the callback buffer.
>
> If there is latency from when the device “consumes" the samples to when
> the signal physically appears at the speaker, this will be reflected in the
> device and stream latency properties. That way, an application can
> calculate the precise host time that an output sample will hit the speaker,
> or what host time an input sample had hit the microphone. On iOS, I think
> AVAudioSession can get you this same info.
>
> Dan
 _______________________________________________
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