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

if read_wave() then write(), the new audio is different in amp. #82

Open
fangpo opened this issue Sep 5, 2021 · 1 comment
Open

if read_wave() then write(), the new audio is different in amp. #82

fangpo opened this issue Sep 5, 2021 · 1 comment

Comments

@fangpo
Copy link

fangpo commented Sep 5, 2021

wave.normalize()

In read_wave(), the call to normalize() makes issue: if read_wave() then write(), the new audio is different in amp.
Suggest don't call normalize(), but convert data to [-1.0, 1.0] using: ys = ys * 1.0 / ( 2 ** (sampwidth * 8 - 1));

122,123d121
< ys = ys * 1.0 / ( 2 ** (sampwidth * 8 - 1));
<
126,127c124
<
< # wave.normalize()

wave.normalize()
@AllenDowney
Copy link
Owner

This is probably a good idea, but I'm going to leave this open for now.

Thanks for this suggestion!

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