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 8985115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:15:42+00:00 2026-06-15T21:15:42+00:00

After I updated app for iOS 6, AVAudioRecorder doesn’t work on a device, and

  • 0

After I updated app for iOS 6, AVAudioRecorder doesn’t work on a device, and crashing in Simulator on [soundRecorder prepareToRecord].

Upd.: audioRecorderDidFinishRecording:successfully: delegate method fires with no delay after [soundRecorder record];

Does anyone find some fix?

- (IBAction)recordSound {
    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
    [appDelegate.audioPlayer stop];
    appDelegate.audioPlayer = nil;

    [self stopPlaying];

    if (soundRecorder.recording) {
        [soundRecorder stop];
        soundRecorder = nil;
        [timer invalidate];
        timer = nil;
        NSError *error;
        [[AVAudioSession sharedInstance] setActive: NO error: &error];
        NSLog([error localizedDescription]);
    }else{
        NSManagedObject *oldSound = _sight.sound;
        if (oldSound != nil) {
            [__managedObjectContext deleteObject:oldSound];
        }
        [self saveContext];

        if (!soundRecorder)
        {
            NSError *errorAudioSession;
            [[AVAudioSession sharedInstance]
             setCategory: AVAudioSessionCategoryPlayAndRecord
             error: &errorAudioSession];
            NSLog([errorAudioSession description]);

            NSDictionary *recordSettings =
            @{AVFormatIDKey: @(kAudioFormatMPEG4AAC),
        AVNumberOfChannelsKey: @1,
        AVEncoderAudioQualityKey: @(AVAudioQualityMedium)};

            NSError *error;
            AVAudioRecorder *newRecorder =
            [[AVAudioRecorder alloc] initWithURL: soundFileURL
                                        settings: recordSettings
                                           error: &error];
            NSLog([error description]);
            soundRecorder = newRecorder;
            soundRecorder.delegate = self;

        }

        [soundRecorder stop];
        [soundRecorder prepareToRecord];
        [soundRecorder record];
        timer = [NSTimer scheduledTimerWithTimeInterval:0.1f target:self selector:@selector(updateRecordStatus) userInfo:nil repeats:YES];

    }
}
  • 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-06-15T21:15:43+00:00Added an answer on June 15, 2026 at 9:15 pm

    I had a problem with audio recording ending as soon as I told it to start recording after the first time in iOS6 (in iOS5 worked great).
    The issue was that I was setting the AVAudioRecorder’s delegate but in iOS6 AVAudioSession’s delegate is deprecated, removing the delegate made my app work again.

    http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAudioSession_ClassReference/DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/occ/instp/AVAudioSession/delegate

    EDIT: as @Flink asked. I have a wrapper class for recording audio (only extends NSObject) that uses the AVAudioRecorder. The relevant part of the code is below:

    ...
    NSError *error = nil;
    audioRecorder = [[ AVAudioRecorder alloc] initWithURL:url settings:recordSettings error:&error];
    //the relevant part of code is this "if"
    if(SYSTEM_VERSION_LESS_THAN(@"6") && delegate){
      audioRecorder.delegate = self.delegate;
    }
    
    BOOL ok = [audioRecorder prepareToRecord];
    
    if (ok){
      if(duration){
        ok = [audioRecorder recordForDuration:duration];
      }
      else {
        ok = [audioRecorder record];
      }
    
      if(!ok) {
        LogError(...);
      }else {
        LogInfo(@"recording");
      }             
    }else {
      LogError(...);    
    }
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I run my iOS app in simulator after updating numerous images within the
After I updated from GAE-JAVA-SDK-1.5.5 to 1.6.0 and 1.6.1 my app stop functioning properly.
I recently updated my app from 2.3.8 to 3.0.rc, but after a while in
Since i updated my iOS software on my iPhone 4, my app that i'm
I recently just updated my work's iOS to 5.1. When I click run in
after using my App created with PhoneGap + iOS for some time, the app
After building my iPad app against iOS 6.0 SDK, I get this weird behavior
After reading: iphone: submit app with iOS 5 and XCode 4.2? I realize that
In IOS Simulator 5.1 this code worked: `instruments -t /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /Users/administrator/Library/Application\ Support/iPhone\ Simulator/6.0/Applications/$numbersstrings/myapp.app/ -e
After update our iphone app can not access the keychain. The distribution certificate has

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.