This should just create a file identical output.wav that is identical to input.wav. I included a check to see if the audio that audio_reader_wav read in was correct, and it was since it outputs yes in the if statement, so I know that audio_reader_wav read in the correct amount of data.
My input.wav file was in stereo 44.1khz containing 443161 samples and it is a bit below 4 mb, at about while the size of the audio output I get is only 4 kb, also at stereo 44.1khz but only 506 samples . I don't get why this is happening because I specified the correct size to write in my call to write(), while the output I get is several orders of magnitude below the intended output. What should I do to solve this?
Edit: On closer inspection it seems like the 506 samples of output.wav are the first 506 samples of input.wav.
Platform: MSYS2 / Clang 11.0.0 on KFR 4.2.0 One of my projects seemed to have odd behavior with audio IO, so I made a test of audio input and output.
This should just create a file identical
output.wav
that is identical toinput.wav
. I included a check to see if the audio thataudio_reader_wav
read in was correct, and it was since it outputsyes
in the if statement, so I know thataudio_reader_wav
read in the correct amount of data.My input.wav file was in stereo 44.1khz containing 443161 samples and it is a bit below 4 mb, at about while the size of the audio output I get is only 4 kb, also at stereo 44.1khz but only 506 samples . I don't get why this is happening because I specified the correct size to write in my call to
write()
, while the output I get is several orders of magnitude below the intended output. What should I do to solve this?Edit: On closer inspection it seems like the 506 samples of
output.wav
are the first 506 samples ofinput.wav
.