0

I'm trying to get the volume of the microphone input with Fmod, but getVolume always returns 0. Yes, I have tested, and my microphone works fine.

This runs in a loop:

float tempvolume = 0.0f;
result = channel->getVolume(&tempvolume);
ERRCHECK(result);

//Set the sound volume
channel->getVolume(&tempvolume);
if (tempvolume < 0.1f){
    do something
}else{
    do something else
}

But like I said, tempvolume is always equal to 0.0

What can I do?

EDIT: I realize now that "getVolume" Merely returns the volume you set for the channel. So the whole question changes now to "How do I detect volume from the microphone?"

Magicaxis
  • 371
  • 7
  • 16

1 Answers1

1

FMOD does not provide any view into the hardware or OS volume level for the microphone.

If you want to measure the volume of the current recording signal consider System::recordStart, play the FMOD::Sound returned then call Channel::getWaveData. You can process the wave data how you like looking for peaks or RMS as required.

Mathew Block
  • 1,613
  • 1
  • 10
  • 9
  • What is the best way to do this now that getWaveData no longer exists? I'd been relying on getWaveData to get the underlying signal within some channel groups, and I'm unsure how to handle now as I make the 64 bit transition.. – crgt Jul 15 '15 at 07:15
  • 1
    If you are only interested in peak or rms consider getting the DSP head for the channel then use getMeterigInfo. If you want to look at all the data consider creating a simple dsp that performs the analysis and add it where you need it. – Mathew Block Jul 16 '15 at 06:41
  • Thanks Matthew, will give that a shot. – crgt Jul 16 '15 at 20:20