ruuda / hound

A wav encoding and decoding library in Rust
https://codeberg.org/ruuda/hound
Apache License 2.0
489 stars 65 forks source link

hound errors out when trying to read samples from this file #81

Open MathieuDuponchelle opened 2 months ago

MathieuDuponchelle commented 2 months ago

When trying to use hound from my application in such a way:

let data: Vec<u8> = wav_file_received_over_the_network;
let reader = match hound::WavReader::new(&data[..])

Hound fails with:

Ill-formed WAVE file: data chunk length is not a multiple of sample size

When dumping that data to file and attempting to use the rms example on it, hound fails in a similar way:

thread 'main' panicked at examples/rms.rs:31:34:
called `Result::unwrap()` on an `Err` value: IoError(Custom { kind: Other, error: "Failed to read enough bytes." })

The file plays back just fine with vlc, you can download it here: <www.mathieudu.com/misc/tmp.wav>

MathieuDuponchelle commented 2 months ago

related to https://github.com/ruuda/hound/issues/63 I assume