iphone - iOS 5 - how to programatically normalize a PCM audio sample? -
iphone - iOS 5 - how to programatically normalize a PCM audio sample? -
i recording 16bit linear pcm file using avaudiorecorder
, saving caf file.
now want normalize sound recorded. cannot find library, either apple or 3rd party, lets me iphone!
peak normalization takes general form, you'll have few conversions, optimizations, , error checking add together 16 bit signal:
double* const buffer(...); const size_t length(...); double max(0); // find peak (size_t idx(0); idx < length; ++idx) max = std::max(max, buffer[idx]); // process double mul(1.0/max); (size_t idx(0); idx < length; ++idx) buffer[idx] *= mul;
iphone ios audio normalization
Comments
Post a Comment