Open fangpo opened 3 years ago
https://github.com/AllenDowney/ThinkDSP/blob/eeef574b4b94c95d57c70c96d9083cd7cd33f346/code/thinkdsp.py#L124
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));
wave.normalize()
This is probably a good idea, but I'm going to leave this open for now.
Thanks for this suggestion!
https://github.com/AllenDowney/ThinkDSP/blob/eeef574b4b94c95d57c70c96d9083cd7cd33f346/code/thinkdsp.py#L124
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()