Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

wav_set_format doesn't properly set block_align? #6

Closed
oskarvonephesos opened this issue Mar 10, 2021 · 1 comment
Closed

wav_set_format doesn't properly set block_align? #6

oskarvonephesos opened this issue Mar 10, 2021 · 1 comment

Comments

@oskarvonephesos
Copy link

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.
Screen Shot 2021-03-10 at 3 22 20 PM

@brglng
Copy link
Owner

brglng commented Mar 14, 2021

@oskarvonephesos Please checkout the latest commit, thanks.

@brglng brglng closed this as completed Mar 14, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants