[Portaudio] How to obtain the time point when computer begins to record?

Mengqi Ren renm at mymail.vcu.edu
Mon Mar 21 12:20:41 EDT 2016

Hello Ross,

Thanks for your suggestions!
In my project, I need to get the computer time when the computer begins to
record. I'm using both Mac OS X and Windows. Which timestamp will be the
highest accurate? What is the difference between Mac OS X and Windows?


On Sun, Mar 20, 2016 at 8:39 PM, Ross Bencina <rossb-lists at audiomulch.com>

> Hello Mengqi,
> On 20/03/2016 7:58 AM, Mengqi Ren wrote:
>> I'm using PortAudio to record audio signals. In my project, I need to
>> know the exact time when computer begins to record.
> There is no such thing as "exact time". What are your requirements? What
> is your use-case?
> Would you please
>> tell me when the recordCallback function is involved and when the first
>> frame of data enters the input buffer?
> There are timestamps passed to the callback that you can use. Their
> accuracy will depend on the platform (you didn't mention your platform). At
> stream start time they are likely to be at their least accurate. You might
> need to collect many timestamps and then process them to estimate the start
> time.
> Is there an API that can return
>> the computer time when microphone begins to record?
> A combination of the callback timestamps and Pa_GetStreamTime() should get
> you there.
> The rest depends on your requirements and the platform(s) that you are
> targeting.
> This is old, but it might help:
> http://www.rossbencina.com/static/writings/portaudio_sync_acmc2003.pdf
> Ross.
> _______________________________________________
> Portaudio mailing list
> Portaudio at lists.columbia.edu
> https://lists.columbia.edu/mailman/listinfo/portaudio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.columbia.edu/pipermail/portaudio/attachments/20160321/92cf68f6/attachment.html>

More information about the Portaudio mailing list