Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6551155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:18:05+00:00 2026-05-25T12:18:05+00:00

I am having trouble getting an accurate meter reading from the AVAudioRecorder (testing on

  • 0

I am having trouble getting an accurate meter reading from the AVAudioRecorder (testing on iPad).

It seems to work fine while the volume is rising, however a delay happens when the volume drops. For example: I speak into the mic and slowly raise my voice. The readings increment from -35.567 to -34.678 up to -10.579 as I would hope, but when I stop talking there is a delay of 1 – 2 seconds before it drops back down to -35.567 (or whatever it happens to be).
The NSLog continues to update from the loop but the meter number stays the same during the delay even though the sound has long ended.

I have added the gist of the code below and would be happy to supply full code if need be.

I initialize the recorder like so:

AVAudioSession * audioSession = [AVAudioSession sharedInstance];
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error: &error];
[audioSession setActive:YES error: &error];

NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init];
[recordSetting setValue :[NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; 
[recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];

recordedTmpFile = [NSURL fileURLWithPath:[NSTemporaryDirectory()  stringByAppendingPathComponent: [NSString stringWithString: @"Recording.caf"]]];

recorder = [[ AVAudioRecorder alloc] initWithURL:recordedTmpFile settings:recordSetting error:&error];
[recorder setDelegate:self];
[recorder prepareToRecord];
[recorder setMeteringEnabled:YES];

[recorder record];

and update the meter in a loop:

-(void) loop:(ccTime)dt 
{
    if(isRecording == YES)
    {        
        //get volume levels
        [recorder updateMeters];
        float level = [recorder peakPowerForChannel:0];
        NSLog(@"Vol: %f", level);
    }
}

edited: I should also mention that I am using the Cocos2d schedule for the loop:

[self schedule:@selector(loop:)];

Any ideas why there would be such a long delay?

edited: I have tried using the average peak power and this has no delay. So I could possibly use that as a work around. However I would rather not use and averaged peak power and it would be nice to understand what is going on.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:18:06+00:00Added an answer on May 25, 2026 at 12:18 pm

    I’m sure that most have figured this out but if you want less lag on your metering you need to use AudioQueue or RemoteIO. See the better explanation here:

    Confusion with meters in AVAudioRecorder

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having trouble getting this to work: /// <summary> /// Retrieve search suggestions from previous
I'm having trouble getting a rotary encoder to work properly with AVR micro controllers.
I'm having trouble getting the following to work in SQL Server 2k, but it
Having trouble getting this syntax right: SELECT DISTINCT id FROM metadata WHERE (meta_key =
Having trouble getting the correct bounds for my iPad application when launching it in
Having trouble getting this to work. What's strange is that I have 10 bookmarks
I having trouble getting append() to work in safari for some reason, but it
I'm having trouble getting Jquery .closest() to work. Here's my code, it's simple and
Having trouble getting the oauth access token and secret exchanged from the request tokens
Having trouble getting my POST arrays to show all checkbox values from my form.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.