Closed moyang628 closed 11 months ago
Your code takes the 16 bit samples and reinterprets them as 24 bit samples without a shift. This means that a wave of maximum amplitude in 16 bits, would be at 1/256 of the maximum amplitude in 24 bits, making it sound silent. If you left-shift by 8 bits before writing the samples, that should resolve your issue. Be careful to widen the i16
sample to i32
before doing the shift.
Similar for 32 to 24 bits, you'd have to right shift by 8 bits and explicitly discard the additional information.
i got it,thanks
Hello
I try to convert 16bit wav to 24bit wav use this crate, the convert file can be generated as 24bit wav file. but there is no sound when I play the generated wav file. and I try to convert 32bit to 24bit ,it is a big noise wav file.
Is there some wrong??
the code: