Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would you like to add a peek() method? #50

Open
abique opened this issue Jan 23, 2024 · 0 comments
Open

Would you like to add a peek() method? #50

abique opened this issue Jan 23, 2024 · 0 comments

Comments

@abique
Copy link

abique commented Jan 23, 2024

Hi,

Would you consider adding a peek method?

pub fn peek(
        &mut self,
        mut frames: usize,
    ) -> Result<ReadData<'_, D::T>, ReadError<D::FatalError>> {
}

It'd be the same as read, except that it would not change the read position.

It can be useful if you have non linear playback of the audio input, you want to interpolate the samples so you need data before and after your current playback position. After what, the playback engine would perform the seek accordingly to its needs.

Thanks,
Alex

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

No branches or pull requests

1 participant