Wave Conversions
ok I''m writing a few functions to convert between diffrent bits per sample/samples per second/channels for wave files... I''ve run into a problem... I''m having problems when it comes to switching between diffrent bits per sample... the end result of it is what kinda sounds like the original file with alot of white noise mixed in... to convert between them I''ve been shifting the samples 8 bits one way or another depending on what is needed... this is the only thing I can think of it being... the other conversions don''t give the slightest bit of noise but this one its almost implosable to here the original wave... anyone got a clue about what is going on?
The Great Milenko"Don't stick a pretzel up your ass, it might get stuck in there.""Computer Programming is findding the right wrench to hammer in the correct screw."
It could be aliasing error from the bit shifts...
Try linear interpolation and if that helps then try cubic splines...
Or your code might be crap, I always seems to have backwards/triangle wave time problems when I work with bit streams...
Magmai Kai Holmlor
- The disgruntled & disillusioned
Edited by - Magmai Kai Holmlor on June 5, 2001 9:13:32 PM
Try linear interpolation and if that helps then try cubic splines...
Or your code might be crap, I always seems to have backwards/triangle wave time problems when I work with bit streams...
Magmai Kai Holmlor
- The disgruntled & disillusioned
Edited by - Magmai Kai Holmlor on June 5, 2001 9:13:32 PM
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
OK, here''s the deal: bits per sample should be easy to do, but the problem is that 8-bit wave files are stored in a completely different manner than 16-bit wave files. I don''t know who''s responsible, but there you have it. 16-bit wave files use signed shorts (i.e. 0V output is 0), and 8-bit wave files use unsigned bytes (0V output is 127 or 128, forget which). So if you account for that, shifting should be the answer.
However, resampling is going to be a problem. Upsampling is probably fine, but downsampling requires you to filter out data above the new sampling frequency, otherwise high-frequency data will alias into your baseband.
However, resampling is going to be a problem. Upsampling is probably fine, but downsampling requires you to filter out data above the new sampling frequency, otherwise high-frequency data will alias into your baseband.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement