Skip to content

Fix WAV chunk padding handling - #7

Merged
mnishiguchi merged 1 commit into
mainfrom
fix/runtime-helper-hardening
Jul 12, 2026
Merged

Fix WAV chunk padding handling#7
mnishiguchi merged 1 commit into
mainfrom
fix/runtime-helper-hardening

Conversation

@mnishiguchi

@mnishiguchi mnishiguchi commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix WAV parsing and concatenation for odd-sized RIFF chunks.

RIFF/WAV chunks are word-aligned, so odd-sized chunks may include one padding byte. Without skipping or writing that padding, parsing can become misaligned and generated WAV output can be malformed.

Changes

  • Skip padding after odd-sized fmt , data, and ignored chunks
  • Add padding when concatenated WAV output has odd-sized data
  • Add focused tests for odd-sized chunks and RIFF size consistency

Verification

  • mix test
  • Confirmed manually in iex -S mix with OpenJTalk.say("元氣ですかあ 、元氣が有れば、なんでもできる")

Skip pad bytes when parsing odd-sized chunks and emit proper padding and RIFF sizes when rebuilding concatenated WAV output.
@mnishiguchi
mnishiguchi merged commit 1e54481 into main Jul 12, 2026
5 checks passed
@mnishiguchi
mnishiguchi deleted the fix/runtime-helper-hardening branch July 12, 2026 08:35
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