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

When converting stereo to mono, divide samples by two to avoid clipping #234

Merged
merged 1 commit into from
Nov 22, 2017

Conversation

ywwg
Copy link

@ywwg ywwg commented Nov 21, 2017

The correct way to convert stereo to mono is to take the average of the two samples, because a full-power sample L and R added together will be 2x full power which will clip horribly. I confirmed this by trying to convert normalized files from stereo to mono. Setting the gain factor to 0.5 is equivalent to (L + R) / 2 and fixes the issue.

ywwg pushed a commit to ywwg/bitbox-editor that referenced this pull request Nov 21, 2017
@jiaaro jiaaro merged commit c95b814 into jiaaro:master Nov 22, 2017
@jiaaro
Copy link
Owner

jiaaro commented Nov 22, 2017

good catch

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.

None yet

2 participants