I am designing a custom media player in C++ using the Microsoft Media Foundation platform. I have most of the basic playback logic down. In order to improve the usefulness of the program, I also need to be able to detect any silence at the beginning or end of any compatible sound file, as well as perform audio normalization.
Based on research I've done thus far, this would involve employing the IMFSourceReader to extract all of the IMFMediaSample objects, and then for each sample extract any and all IMFMediaBuffer objects.
Upon locking the buffer, I'll have the byte of data contained therein. How do I interpret this data in such a way as to determine "loudness", and then manipulate the data to adjust loudness?