4
$\begingroup$

When capturing microphone audio, I noticed that my static buffer eventually overflows.

So I timed the samples, and low and behold I'm getting an actual sample rate of 44102-ish Hz (my timer is very accurate).

Is this the actual sample rate recorded by my microphone, or is windows sending me samples twice?

Doesn't this cause all sorts of synchronization problems. Say if you're listening to a live recording, wont a noticeable lag start to accumulate if sample rates aren't exact? How is this problem solved traditionally? Is dropping a sequence of samples, or padding zeros normal?

$\endgroup$

1 Answer 1

5
$\begingroup$

If you calculate the error, 44102/44100 is only about 45 parts per million. That is well within operating tolerance of many crystal oscillators used in consumer equipment to generate audio sampling rates and USB communication clocks. You can be quite pleased it is not even more off. Another problem is that if you simultaneously use different devices for audio capture or playback, they each have their own local clocks so they are not synchronized in any way and they all run free with their own local clockd, and thus you will have to do some kind of resampling to adapt the slight sampling rate differences.

$\endgroup$
1
  • 2
    $\begingroup$ This is correct. I've implemented digital communications systems using computer sound cards, and their sampling rates are always different, even when the sound cards belong to the same batch. This is to be expected given the intrinsic inaccuracy of crystal oscillators. $\endgroup$
    – MBaz
    Aug 31, 2020 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.