HowTo: Read Sound Volume in RealTime

  • Thread starter Thread starter Andreas Hecker
  • Start date Start date
A

Andreas Hecker

Hello,
when i play a sound file like mp3 or wav with MediaPlayer or anything like
this, i would like to get the volume level of the sound card in real time.
The data is then sent to the serial port. How do i get this data. I tried to
find some samples in msdn or internet but i couldn t find any useful code.
There is the winmm.dll which supports calls to waveIn and waveOut but all
the samples use them to set or get the master volume. That is not what i
need. I thought i found a sample in msdn, but this doesnt work. Can anybody
help me??
 
Thank you Ken, but this class also uses the Properties to get or set the
master volume. They do not provide real time data. I know that there is a
way, because there is an ocx which shows as an real-time led but without
getting the data. Perhaps there is an other solution?
 
Hi, unfortunately I cannot offer a solution, but I think you're referring to
the output level, not the actualy volume of output, e.g. the amplitude of
the sound coming out the speaker at any one instant in time.

I tried doing this once, but I fell flat on my face as there was
limited/incomplete examples around the net, having said that, this was about
2 years ago, so you might want to check again.

Anywho, I eventually found that the most results tended around something
called a "VU Meter", or "audio level"

Happy Googling :)

--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
 
Back
Top