Skip to content

add WavSpec chaining methods#95

Closed
ozpv wants to merge 1 commit intoruuda:masterfrom
ozpv:wavspec-methods
Closed

add WavSpec chaining methods#95
ozpv wants to merge 1 commit intoruuda:masterfrom
ozpv:wavspec-methods

Conversation

@ozpv
Copy link
Copy Markdown

@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();

@ozpv ozpv closed this by deleting the head repository Apr 18, 2026
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