Problem with custom USB microphone
That can be a lot of things, most including software problems, but in all likelihood:

This is a rate mismatch problem. Either, your software can't resample the 8 kHz to its internal sampling rate e.g. for codecs, or you think you're doing 8 kHz, where in reality you're doing 7.992 kHz or 8.008 kHz (or some other variation).

So, encoder expect 8000 samples a second an average, gets less (or more), and things run out of sync.

Solution:


Make sure the oscillator you used for generating the 8 kHz is not your source for clock mismatch
Try using a higher sampling rate; not all clock generators are equal, and 8 kHz sampling rate is really unusually low for PC audio systems (because the highest signal frequency you can represent with that is just under 4 kHz; that's lower than what you'd typically want, anyways, because the signal power spectrum useful for making speech intellegible extends to beyond 5 kHz. 4 kHz just gives you slightly better sound than the POTS-typical 3.4 kHz cutoff, so you'll sound like people on the phone in old movies.