HowTo: Read Sound Volume in RealTime
-
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. Is directX a way to solve this problem? Can anybody help me??
-
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. Is directX a way to solve this problem? Can anybody help me??
Do you want the "volume level" or the sampled peaks of the output going to the speakers? Volume is simple, you've already found the code for it. Sampling the output is a whole other story. Now you have to consider getting the output of 1 to 8 speakers. This sampling can occur very fast, but can your serial port implementation keep up with the rate of data you want to transmit? How fast are you looking at sending data out the serial port? You might want to look at this[^] link for a sample on MSDN. RageInTheMachine9532