Conversation
|
Buffers on the buffer stack might not always be stereo, or mono. They can have any number of channels. Instead of having individual variables for "left" and "right", I'd suggest having C arrays for peak and avg, dynamically allocated by the module initializer, like |
|
Thanks lijon, that makes sense - I'll take a stab at changing it. |
|
@lijon - I've updated the AEMeteringModule.h/AEMeteringModule.m files to allow for variable number of audio channels. |
|
Looks good! Another thing that I didn't think of before: the levels you read from this module is only the levels for the last buffer. So it can't be used for any real metering purposes - there might have been a peak in between the calls that you never see! Instead, one should get the average and peak levels since last retrieval of the levels. Take a look at the metering code in TAAE1, it uses a |
|
Thanks for the great feedback! I'm going to work on this some more. |
I cleaned up the files a bit as per your suggestions first, then merged just the AEMeteringModule.h/m files into master. I updated TheAmazingAudioEngine.h to import the new files.