Skip to content

Fix WAV chunk ordering and RIFF padding#232

Open
AnthonyRonning wants to merge 1 commit into
masterfrom
codex-opensecret-wav-chunk-order-opensecret
Open

Fix WAV chunk ordering and RIFF padding#232
AnthonyRonning wants to merge 1 commit into
masterfrom
codex-opensecret-wav-chunk-order-opensecret

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reject data chunks that precede the mandatory fmt chunk instead of emitting split WAV files without format metadata
  • word-align odd-length data chunks and reserve their pad byte within the configured chunk-size limit
  • use checked output sizing and RIFF u32 conversions before constructing each split file
  • parse and validate every emitted chunk in regression tests, including odd optional chunks and valid 8-bit mono data

Format rule

RIFF/WAVE allows optional and unknown chunks around the mandatory chunks, but fmt must precede wave data. Appendix A of EBU Tech 3285 reproduces this Microsoft RIFF/WAVE ordering rule.

Validation

  • nix develop -c cargo fmt --all -- --check
  • nix develop -c cargo clippy --locked --all-targets --all-features -- -D warnings
  • nix develop -c cargo test --locked --all-features (215 passed, 16 ignored)

Open in Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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 this pull request may close these issues.

1 participant