Search code examples
c++audiodirectshow

get loudness level from raw data recieved from microphone in DirectShow


How I can get loudness level from raw data received from microphone in DirectShow?

IMediaSample keep data in bytes. And how I can read this bytes and get something?


Solution

  • Loudness is an aural quality, not a physic formula. There are many many definitions for it.

    It's a also a temporal value. As a consequence, this value changes during the time.

    The simplest implementation I remember I had seen some years ago, was simply putting a time out on the maximum value of the amplitude. But the log of the amplitude is surely better to approximate the ear sensitivity much closer.

    You can also consider the power of the signal ( signal * signal ... but there are also more definitions that takes into account the frequency spectrum components...).

    It's kitchen recipes. Choose the simplest.

    Edit: it seems my answer was too fast and fuzzy, I probably mistake Volume and Loudness. this wikipedia article states there are units for measuring loudness. Sone and Phon.