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

Sound BlipBufs are created with sample_rate as its "sample_count" parameter. #27

Closed
Altaflux opened this issue Sep 28, 2024 · 1 comment

Comments

@Altaflux
Copy link

Altaflux commented Sep 28, 2024

I believe that when Blip Blufs are being created the sample rate is being incorrectly used as the "sample_count" parameter.
Although this does not causes any errors it creates BlipBufs which are unnecessarily big in size as the buffer the same size as the sample rate which only need to contain enough space to hold the OUTPUT_SAMPLE_COUNT.

https://github.com/mvdnes/rboy/blob/main/src/sound.rs#L711

The correct usage would be to pass the "OUTPUT_SAMPLE_COUNT + 1" as a parameter when initializing the BlipBuf.
I am not really sure why the +1 is needed.

@mvdnes
Copy link
Owner

mvdnes commented Sep 29, 2024

Thank you! 👍
I have resolved this in dbf75f8.

@mvdnes mvdnes closed this as completed Sep 29, 2024
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