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

Fix WDM-KS buffer position alignment #931

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

dechamps
Copy link
Contributor

The previous code is only correct if bytesPerFrame is a power of two. If it's not (e.g. 2-channel 24-bit = 6 bytes per frame), then the computed buffer position is corrupted. This can lead the code to use the wrong buffer half, resulting in glitchy audio.

Fixes #763

The previous code is only correct if `bytesPerFrame` is a power of two.
If it's not (e.g. 2-channel 24-bit = 6 bytes per frame), then the
computed buffer position is corrupted. This can lead the code to use
the wrong buffer half, resulting in glitchy audio.

Fixes PortAudio#763
Copy link
Collaborator

@RossBencina RossBencina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I approve.

Just wondering whether a comment like /* note bytesPerFrame can be non-power-of-two */ might be an improvement.

@RossBencina
Copy link
Collaborator

Thanks for tracking this down. Great to have our WDM/KS support inch closer to solidity. I'll wait for Phil's review before merging.

@RossBencina RossBencina requested a review from philburk June 21, 2024 23:41
Copy link
Collaborator

@philburk philburk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@RossBencina RossBencina merged commit 2f61007 into PortAudio:master Jun 28, 2024
11 checks passed
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.

WDM-KS audio is choppy with some values of suggestedLatency
3 participants