Skip to content

Conversation

@ozpv
Copy link

@ozpv ozpv commented May 24, 2025

Adds some methods that makes code easier to write

changing a sample rate before e.g.:

let r = WavReader::open("signal.wav").unwrap();
let mut w = WavWriter::create("output.wav", {
    let mut spec = r.spec();
    spec.sample_rate = 8_000;
    spec
})
.unwrap();

After

let r = WavReader::open("signal.wav").unwrap();
let mut w = WavWriter::create("output.wav", r.spec().sample_rate(8_000)).unwrap();

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