Time Between Callbacks?

I have a laboratory project that uses mainly PyAudio and to further understand its way of working. I made some measurements, in this case the time between callbacks (using the callback mode).

I timed it and got an interesting result

(mesh size 256, 44.1k fs): 0.0099701; 0.0000365; 0.0000201; 0,0201579

This pattern can go on and on.

Between two longer calls, we have two short calls, and sometimes a longer call is shorter (remember that I am not doing anything in the program except callback times).

If we average this, we get the desired callback time:

1/44100 * 256 (approximately 5.8 ms)

Here is my dimension: enter image description here

So can someone explain what exactly is happening here under the hood?

+4
1

PortAudio, , :

  • API PortAudio
  • Pa_OpenStream()
  • , , .

PortAudio API PortAudio . , .

, API , (framesPerBuffer), Pa_OpenStream()). PortAudio , , "" . .

, API . , PortAudio API- , , , , . .

.

, , , PortAudio 3 (, 3x ) , .

, PortAudio . , PortAudio , . , , DirectSound Windows 7. ASIO4ALL +/- 1 ( , ).

0 , . , . , - paFramesPerBufferUnspecified, , - , , , .

, API- , , .

, API API PortAudio, PortAudio.

: ? , , Pa_OpenStream(). API- PortAudio , , , .

+5

Source: https://habr.com/ru/post/1537477/


All Articles