Skip to content
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

Fix issue where padding was not skipped when reading odd-sized chunks from WAV files #1117

Merged
merged 4 commits into from Mar 14, 2024

Conversation

loliball
Copy link

If a chunk body has an odd number of bytes, it must be followed by a padding byte with value 0. In other words, a chunk must always occupy an even number of bytes in the file. The padding byte should not be counted in the chunk header’s size field. For example, if a chunk body is 17 bytes in size, the header’s size field should be set to 17, even though the chunk body occupies 18 bytes (17 bytes of data followed by the padding byte).

https://wavefilegem.com/how_wave_files_work.html

@loliball
Copy link
Author

@rohitjoins rohitjoins self-assigned this Feb 24, 2024
@rohitjoins rohitjoins changed the title Fixed missing skip padding issue when reading odd sized chunks from wav files. Fix issue where padding was not skipped when reading odd-sized chunks from WAV files Feb 27, 2024
@rohitjoins
Copy link
Contributor

I'm going to send this for internal review now. You may see some more commits being added as I make changes in response to review feedback. Please refrain from pushing any more substantive changes as it will complicate the internal review - thanks!

@copybara-service copybara-service bot merged commit e9a28be into androidx:main Mar 14, 2024
1 check passed
@loliball loliball deleted the dev_wav_align_fix branch March 15, 2024 16:00
SheenaChhabra pushed a commit that referenced this pull request Apr 8, 2024
PiperOrigin-RevId: 615820438
(cherry picked from commit e9a28be)
l1068 pushed a commit to l1068org/media that referenced this pull request Apr 15, 2024
PiperOrigin-RevId: 615820438
(cherry picked from commit e9a28be)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants