Hi there!
I'm using your library to write a single channel of floats to a wav file. To open the file I run:
WavFile* fp;
fp = wav_open(file_path, restrict_mode);
wav_set_format(fp, WAV_FORMAT_IEEE_FLOAT);
wav_set_sample_size(fp, sizeof(float));
wav_set_num_channels(fp, 1);
wav_set_sample_rate(fp, SR);
Calling wav_set_sample_size is necessary, because otherwise I get incorrect files (which I think my have to do with block_align -- I have posted a picture: the upper audio is produced by the code shown above, the lower picture is the audio produced without wav_set_sample_size. On import, Audacity et al warn about a corrupted header). It does seem quite redundant, though, that I specify the format as floats and set the sample_size to be sizeof(float) as well.
Hi there! I'm using your library to write a single channel of floats to a wav file. To open the file I run: WavFile* fp; fp = wav_open(file_path, restrict_mode); wav_set_format(fp, WAV_FORMAT_IEEE_FLOAT); wav_set_sample_size(fp, sizeof(float)); wav_set_num_channels(fp, 1); wav_set_sample_rate(fp, SR);
Calling wav_set_sample_size is necessary, because otherwise I get incorrect files (which I think my have to do with block_align -- I have posted a picture: the upper audio is produced by the code shown above, the lower picture is the audio produced without wav_set_sample_size. On import, Audacity et al warn about a corrupted header). It does seem quite redundant, though, that I specify the format as floats and set the sample_size to be sizeof(float) as well.