Skip to content

Odd RIFF size when frame width is 1 byte and data chunk has odd number of samples #92

@4LT

Description

@4LT

I think hound is producing malformed WAV files when encoding 1-channel and an odd number of 8-bit samples. Here's my reasoning:

  • As per the documentation I could find (https://www.recordingblogs.com/wiki/wave-file-format) chunks must be 16-bit aligned; if the chunk size is odd, then an additional padding byte is required (I believe this is true of any RIFF format)
  • While individual chunks may have odd-numbered chunk sizes, the RIFF chunk contains only other chunks including their padding bytes
  • Therefore a valid WAV file should always have a RIFF chunk with an even-number size

However, when writing a wave file with an odd number of 8-bit samples, I'm getting files with odd-numbered RIFF sizes.

Tested with Hound v3.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions