portaudio timing

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
biggil
Posts: 8
Joined: Mon Nov 18, 2013 5:49 am
Operating System: Please select

portaudio timing

Post by biggil » Mon Nov 18, 2013 6:31 am

hello, I'm new here. I am a developer. MacOSX 10.7

I have a portaudio (v1.9) specific question.
I'm writing a program that records audio. Using a callback.
I'm trying to synchronise audio and MIDI as precisely as possible.
That is, I send MIDI notes to an external synth device, and record the audio that's played.
Just after calling Pa_StartStream(), I get the Start Time with Pa_GetStreamTime().
About 370 ms later, when the 1st call back is fired, the ADC time of the 1st audio input buffer is 8 millisecond before the Start Time.

what does that means ?
seems that portaudio (upon CoreAudio) was already recording before I told it ?

And, why always 8 ms ?
What kind of accuracy can portaudio achieve ?

If any idea … thank you !

greetings

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: portaudio timing

Post by steve » Mon Nov 18, 2013 7:07 am

Topic moved to "General Audio Programming".

You would probably do better to ask this type of question on the Portaudio mailing list. The Audacity developers rarely come to the forum, and when they do they generally only respond to questions that are specifically about Audacity.

See my previous post for how to contact Portaudio. http://forum.audacityteam.org/viewtopic ... 02#p228802
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

schmide
Posts: 22
Joined: Sun Oct 06, 2013 1:01 am
Operating System: Please select

Re: portaudio timing

Post by schmide » Mon Nov 18, 2013 9:53 pm

Just a quick thought.

8ns = 0.008 = 1/125 which in turn is 384 samples (typical aligned small buffer) from a 48000hrz sample rate.

You're always going to have latency equal to the size of your buffer.

Post Reply