New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add S24_LE wav files and tests #41
Conversation
Thanks! This looks good to me so far.
Lines 511 to 514 in 10673f8
Or we could even already construct the Do you want to add that to this pull request? |
Add function read_le_i24_4 which reads a little-endian i24 sample stored within a 4 byte chunk. This is used for decoding S24_LE wav files.
Got both tests passing. I wasn't sure what your format preferences were, since it seems like you're not using |
Loosen the restriction that bitsPerSample exactly equals blockAlign / numChannels * 8. In doing so, we allow playback of wav files that, while standards non-conforming, are common in the wild.
Add two test files, one using pcmwaveformat with bitsPerSample == 24, and one using waveformatextensible with validBitsPerSample == 24. Also add tests that verify these two files are properly read. According to the standard, the first sort of file should not be permitted, but it is created by arecord, so it is a good type of file to try and support.
Fixed some build errors on old rust. |
I don’t have a strong preference on formatting, it looks good to me. Thanks for only formatting the modified lines and not the entire file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks for implementing this!
The second patch in the series gets read_wav_wave_format_extensible_pcm_24bit_4byte() to pass, but the other test will need some deeper changes to work (potentially adding a frame size field which is block_align / num_channels ?)