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

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -