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

A question about the player in demo/ #46

Open
DoormatIka opened this issue Nov 10, 2023 · 1 comment
Open

A question about the player in demo/ #46

DoormatIka opened this issue Nov 10, 2023 · 1 comment

Comments

@DoormatIka
Copy link

while data.len() >= num_channels {
    let read_frames = data.len() / 2;

In the demo/player/src/process.rs file, what does this do exactly?

Why is it dividing cpal's data length to 2?
Is it to adjust the buffer length for creek to parse through?

I am new to working with sound so I apologize if this is obvious for you.

@Be-ing
Copy link
Collaborator

Be-ing commented Nov 12, 2023

This seems to be assuming the buffer has 2 channels (stereo). 2 should probably be replaced with num_channels.

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

2 participants