ruuda / hound

A wav encoding and decoding library in Rust

Home Page:https://codeberg.org/ruuda/hound

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exclude examples/samples from crate

s0be opened this issue · comments

The crate currently pulls in the samples/ (which adds cpal as a dep) and the testsamples/ (which don't have their license specified). I don't believe these are actually necessary for the use of hound.

Cpal is a dev-dependency, used for the cpal example. You don't need it if you want to use Hound, and if you add Hound to your Cargo.toml, that will not add any transitive dependencies.

Hound is licensed under the Apache 2.0 license, including the test code and test samples. These samples are just a few bytes large, with the data hard-coded in the tests too, such as this one:

hound/src/read.rs

Lines 1167 to 1181 in bcd553c

#[test]
fn read_wav_32bit() {
let mut wav_reader = WavReader::open("testsamples/waveformatextensible-32bit-48kHz-stereo.wav")
.unwrap();
assert_eq!(wav_reader.spec().bits_per_sample, 32);
assert_eq!(wav_reader.spec().sample_format, SampleFormat::Int);
let samples: Vec<i32> = wav_reader.samples()
.map(|r| r.unwrap())
.collect();
// The test file has been prepared with these exact four samples.
assert_eq!(&samples[..], &[19, -229_373, 33_587_161, -2_147_483_497]);
}