Description
I’m having trouble converting the written AudioRawData to a .wav file. After I convert from raw PCM to WAVE the audio plays random static. The static also is a different length than my original recording. Here’s my code:
In onMixedAudioRawDataReceived
ofstream f;
…
f.open("example.pcm", ios::out | ios::binary | ios::app);
…
char* buf = data_->GetBuffer();
f.write(buf, strlen(buf));
Then I have tried to convert the file using ffmpeg:
ffmpeg -f s16le -ar 32k -ac 1 -i example.pcm example.wav
and using sox:
sox -t raw -r 32000 -e signed --endian little -b 16 -c 1 example.pcm -r 32000 example.wav
But example.wav just plays static. I can’t figure out where my code is going wrong and would appreciate any help.
Which Windows Meeting SDK version?
v5.10.3.4873.
I figured I’d also add that I get the following two errors when I run the ffmpeg command:
Invalid PCM packet, data has size 1 but at least a size of 2 was expected
Error while decoding stream #0:0: Invalid data found when processing input