udoprog / audio

A crate for working with audio in Rust
Apache License 2.0
78 stars 11 forks source link

Are Buf::skip and Buf::tail redundant? #11

Open Be-ing opened 2 years ago

Be-ing commented 2 years ago

From reading the examples in the documentation, they seem to do the same thing. Also the text of the documentation for these functions is identical "Construct a new buffer where n frames are skipped."

Be-ing commented 2 years ago

Oh, does skip start n frames from the beginning of the buffer and tail start n frames back from the end? If so, the examples both go 2 frames into a 4 frame buffer, which happens to be the same result whether you go 2 from the beginning or 2 from the end. :) In that case, the examples could be adjusted to not index exactly half way into an even sized buffer.

udoprog commented 2 years ago

Yeah, I think it's just the documentation that is wrong.