Depending on the used WAV samplerate the current code is either to slow or it wastes to much time somewhere.