Hello, I am working on a program in which I would like to have a real-time VU- meter. I have got experience with DirectShow programming and it seems that I need to use the SampleGrabber filter for this. But that's where my knowledge stops (I know how to get samples with it though). I would like to use the Win32 API in combination with DirectShow and the C++ programming language. My questions are: - How can I use DirectShow for getting the audio-data in the proper format, so that I can display it in a VU-meter? (perhaps convert it to dB first?) - Is it in this way possible to have a real-time VU-meter? Any comments or hints are welcome. Thanks in advance.
From: "j.ronner@chello.nl" > - How can I use DirectShow for getting the audio-data in > the proper format, so that I can display it in a > VU-meter? (perhaps convert it to dB first?) To measure the amplitude (which is nothing more than the absolute value of the waveform samples), you just need uncompressed PCM data. So insert your SampleGrabber after the decoder or the live source. You will need to average the amplitude over short buffers (0.1-0.5 secs). You can display the intensity instead, which is the RMS (square root of the average square of the samples), which is a better representation of the perceived volume/loudness. > - Is it in this way possible to have a real-time VU-meter? Yes. -- // Alessandro Angeli // MVP :: DirectShow / MediaFoundation // mvpnews at riseoftheants dot com // http://www.riseoftheants.com/mmx/faq.htm
On Mon, 23 Jun 2008 14:42:19 -0400, Alessandro Angeli wrote: > To measure the amplitude (which is nothing more than the > absolute value of the waveform samples), you just need > uncompressed PCM data. So insert your SampleGrabber after > the decoder or the live source. You will need to average the > amplitude over short buffers (0.1-0.5 secs). You can display > the intensity instead, which is the RMS (square root of the > average square of the samples), which is a better > representation of the perceived volume/loudness. The peak dB value is more commonly used in the digital world. This is mainly because you are trying to achieve maximum dynamic range but without clipping. -- http://www.chrisnet.net/code.htm [MS MVP for DirectShow / MediaFoundation]