Using WAV as the audio recording format resulted in corrupted files where the chunk length did not properly correspond to the actual chunk content or file length.
This was caused by initially writing the audio samples to the start of the file instead of the data chunk. On close, writing the WAV header would then overwrite the first bytes of audio.
Using WAV as the audio recording format resulted in corrupted files where the chunk length did not properly correspond to the actual chunk content or file length.
This was caused by initially writing the audio samples to the start of the file instead of the data chunk. On close, writing the WAV header would then overwrite the first bytes of audio.