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

chunk.Size includes padding #2

Open
stevenh opened this issue Apr 6, 2023 · 0 comments · May be fixed by #3
Open

chunk.Size includes padding #2

stevenh opened this issue Apr 6, 2023 · 0 comments · May be fixed by #3

Comments

@stevenh
Copy link

stevenh commented Apr 6, 2023

When fixing the parsing in wav for DecodeListChunk I tripped over the fact that Chunk.Size doesn't represent the head value as described:

Chunk represents the header and containt of a sub block

Instead it also includes the padding byte, which makes parsing more complex as you need to check for a remaining byte and ignore it instead of being able to simply rely on io.EOF.

I would instead suggest that the extra byte is handled by Chunk.Drain.

stevenh added a commit to stevenh/riff that referenced this issue Apr 6, 2023
Fix chunk.Size to match the definition, removing the additional padding
byte which was previously present. This allows consumers to create
cleaner parsing which relies on io.EOF instead of having to also check
for a padding byte.

Also:
* Fix some typos.
* Clarify that IsFullyRead doesn't include the padding byte.

Fixes go-audio#2
@stevenh stevenh linked a pull request Apr 6, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant