# No Information from getMeteringInfo

**URL:** <https://qa.fmod.com/t/no-information-from-getmeteringinfo/11747>\
**Category:** FMOD Engine\
**Created:** [December 3, 2014, 1:41am UTC](https://qa.fmod.com/t/no-information-from-getmeteringinfo/11747 "2014-12-03T01:41:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmm8](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@jmm8](https://qa.fmod.com/u/jmm8)\
**Post date:** [December 3, 2014, 1:41am UTC](https://qa.fmod.com/t/no-information-from-getmeteringinfo/11747/1 "2014-12-03T01:41:08Z")

</div>

So I’m trying to get the volume of a sound using getMeteringInfo, and am just getting no data. I’ve been following this example: [http://52.88.2.202/questions/question/microphone-input-playback](http://52.88.2.202/questions/question/microphone-input-playback)  
but have not actuall been able to get any information back (i.e. it’s all zeros). Here’s my code:

When the sound is created:

```
//eventually, I'm going to be recording a sound, but I'm trying to get it working first on
//just a normal sine wave that I know the expected value for
        memset(&m_exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
        m_exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
        m_exinfo.numchannels = m_fmodrecordchannels;
        m_exinfo.format = FMOD_SOUND_FORMAT_PCM16;
        m_exinfo.defaultfrequency = m_fmodrecordrate;
        m_exinfo.length = m_exinfo.defaultfrequency * sizeof(short) * m_exinfo.numchannels\
     * .7;

    result = m_fmodSystem->createSound( "400Hz.wav", FMOD_LOOP_NORMAL | FMOD_DEFAULT, &m_exinfo,\
     &m_sound);
        ERRCHECK( result);

    result = m_fmodSystem->playSound(m_sound, 0, false, &m_channel);
    ERRCHECK( result );

    result = m_channel->getDSP(FMOD_CHANNELCONTROL_DSP_FADER, &m_loudnessdsp);
    ERRCHECK( result );

    result = m_loudnessdsp->setMeteringEnabled( true, true );
    ERRCHECK( result );

```

then, called repeatedly (whenever the screen is re-rendered):

```
FMOD_DSP_METERING_INFO preMeter, postMeter;
    result = m_loudnessdsp->getMeteringInfo( &preMeter, &postMeter );
    ERRCHECK( result );

    float avgVol = 0;

    debugPrintf( "short: %hu\n", preMeter.numchannels );
    debugPrintf( "numberofsamples: %d\n", preMeter.numsamples );

    for( int i = 0; i < preMeter.numchannels; ++i ) {
        avgVol += preMeter.rmslevel[i];
        debugPrintf( "rms: %f\n", preMeter.rmslevel[i] );
        debugPrintf( "peak: %f\n", preMeter.peaklevel[i] );

    }

    avgVol = avgVol/preMeter.numchannels;

    m_curr_vol = avgVol;

```

When I do this, all of the values are zero. I’ve checked and m\_sound is the sound that is playing (it is - I can hear it) and it is the sound that is playing in m\_channel. The only other DSP on there is an FFT which shouldn’t be affecting the track at all, just getting the dominant frequency from it. This also doesn’t work if I actually record a sound rather than trying to load it from a file (using recordStart and not looping). Anyone have any ideas as to why no information is being returned?

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [December 3, 2014, 6:20am UTC](https://qa.fmod.com/t/no-information-from-getmeteringinfo/11747/2 "2014-12-03T06:20:10Z")

</div>

Are you calling FMOD::System::update() every frame?
