AvAudioRecorder, create corrupted file on random check

Hello,
I face issue with AvAudioRecorder, create corrupted file on random check.
below is complete functionality code.
-(IBAction)btnRecordClick:(id)sender {
    [PlayingTimer invalidate];
    PlayingTimer = nil;
    if (isPaused==NO) {
        AVAudioSession *audioSession = [AVAudioSession sharedInstance];
        NSError *err = nil;
        [audioSession setCategory :AVAudioSessionCategoryPlayAndRecord error:&err];
        if(err){
            // NSLog(@"audioSession: %@ %d %@", [err domain], [err code], [[err userInfo] description]);
            return;
        [audioSession setActive:YES error:&err];
        err = nil;
        if(err){
            // NSLog(@"audioSession: %@ %d %@", [err domain], [err code], [[err userInfo] description]);
            return;
        //*******Working well with .wav,.caf and .mp4 files *****************
        recordSetting = [[NSMutableDictionary alloc] init];
        //this is for .wav and .caf file
        //this is for .mp4 file for iPhone 3GS/iPhone 4
        [recordSetting setValue: [NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey];
        [recordSetting setValue: [NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
        [recordSetting setValue: [NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];
        [recordSetting setValue:[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey];
        [recordSetting setValue:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsBigEndianKey];
        [recordSetting setValue:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsFloatKey];
        self.strMessage = @"";
        self.strMessageType = [NSString stringWithFormat:@"Audio Message"];
        self.strFileName = [NSString stringWithFormat:@"%@.mp4", [_globalmodel stringUniqueID]];
        // NSLog(@"FileName :%@",self.strFileName);
        self.strUniqueRef = [NSString stringWithFormat:@"%@",[_globalmodel stringUniqueID]];
        NSString *soundPath;//=[NSString alloc];
        soundPath = [NSString stringWithFormat:@"%@/%@", DOCUMENTS_FOLDER,self.strFileName] ;
        NSURL *url1 = [NSURL fileURLWithPath:soundPath];
        // NSLog(@"Recording Path:%@",url1);
        err = nil;
        recorder = [[ AVAudioRecorder alloc] initWithURL:url1 settings:recordSetting error:&err];
        if(!recorder){
            // NSLog(@"recorder: %@ %d %@", [err domain], [err code], [[err userInfo] description]);
            UIAlertView *alert =[[UIAlertView alloc] initWithTitle: @"My Easy Media"
                                                           message: @"The Recording format is not supported on your device!"
                                                          delegate: nil
                                                 cancelButtonTitle:@"OK"
                                                 otherButtonTitles:nil];
            [alert show];
            [alert release];
            return;
        //prepare to record
        [recorder setDelegate:self];
        [recorder prepareToRecord];
        recorder.meteringEnabled = YES;
        BOOL audioHWAvailable = audioSession.inputIsAvailable;
        if (! audioHWAvailable) {
            UIAlertView *cantRecordAlert =
            [[UIAlertView alloc] initWithTitle: @"Warning"
                                       message: @"Audio input hardware not available"
                                      delegate: nil
                             cancelButtonTitle:@"OK"
                             otherButtonTitles:nil];
            [cantRecordAlert show];
            [cantRecordAlert release];
            return;
        // start recording
        [recorder record];
        _isRecordingStarted = YES;
        // SET TIMER // START TIMER
        timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(EndRecording:)
                                               userInfo:nil repeats:YES];
        // END TO SETTING TIMER
        timerDisplayRight.hidden = NO;
        timerDisplayLeft.hidden = NO;
        timerDisplayRight.text = [NSString stringWithFormat:@"%02d:%02d", intMimute,-- intSecond];
        timerDisplayLeft.text = [NSString stringWithFormat:@"00:00"];
        progressView.progress = 0.0;
    else {
        isPaused=NO;
        [recorder record];
        _isRecordingStarted = YES;
        [btnReview setEnabled:NO];
        timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(EndRecording:)
                                               userInfo:nil repeats:YES];
        timerDisplayRight.hidden = NO;
        timerDisplayLeft.hidden = NO;
    timerDisplayRight.text = [NSString stringWithFormat:@"%02d:%02d", intMimute,-- intSecond];
-(IBAction)btnPauseClick:(id)sender {
    // NSLog(@"Pause Button of ActionSheet Clicked");
    [timer invalidate];
    timer = nil;
    isPaused=YES;
    [recorder pause];
    [btnPause setEnabled:NO];
    [btnRecord setEnabled:YES];
    [btnStop setEnabled:YES];
-(IBAction)btnStopClick:(id)sender {
    // NSLog(@"Stop Button of ActionSheet Clicked");
    [recorder stop];
    progressView.progress = 1.0;
    // NSLog(@"Total Recording Secomd : %d", totalRecordingSecond);
    finalRecordingSecond = totalRecordingSecond;
    [btnStop setEnabled:NO];
    [btnReview setEnabled:YES];
    [btnRecord setEnabled:YES];
    [btnPause setEnabled:NO];
    timerDisplayRight.text = [NSString stringWithFormat:@"%02d:%02d", (totalRecordingSecond/60), (totalRecordingSecond % 60) ];
    timerDisplayLeft.text = [NSString stringWithFormat:@"00:00"];
    [timer invalidate];
    timer = nil;
    // REINITIALIZE TIMER VARIABLES...
    intMimute =  5;
    intTotalTime = (60 * intMimute);   
    intSecond = intTotalTime / intMimute;
    intMimute--;       
    // REINITIALIZE TIMER VARIABLES...       
    _isRecordingStarted = NO;
Please help.
once we start recored and after near about 10 to 15 second, tap on stop.
It create file with length 24kb, which is not occured all time, but randomly found file is courrupted.

I've been having the same problem for over a week for the Yankees @ Red Sox MLB's games of the year. I've reported the problem to apple by logging into my account in iTunes > purchase history > report problem. I know of several other people who have the same problems.

Similar Messages

  • Pdf creator is creating corrupt file on Mac with Mountain Lion

    pdf creator is creating corrupt file on Mac with Mountain Lion, how to rectify?

    Please say what PDF creator you have including version
    and how you know they are corrupt

  • Score export to PDF creating corrupt file

    I have a three page score in the "guitar mix" format. Using the camera tool to export to a PDF, page 1 comes out fine, but pgs 2 and 3 won't open in Preview. It says the file is corrupt.
    I have restarted the machine already. No change.

    When you print to Pdf check the Page Setup box Scale does not say a tiny percentage like 2% or something. Check that it is 100%...
    Hope this helps.

  • My Mac creating corrupted files

    Hi guys,
    I seem to have an incredibly frustrating problem with my Mac. I have a Mac OS X version 10.5.4. Build 9E27 with 2.66 GHz Intel Core 2 Duo and 2GB Ram.
    Lately I've been experiencing some problems regarding graphics. It may have started two weeks ago. It seems that whatever I create, I have problems uploading to web servers and emailing. They send through, however the graphics are always corrupted. Either with random lines on top of the graphics, or only show 1/4 of the graphics with the rest grayed out, or the image is demented or the whole thing is blacked out. However when I tried printing these very same graphics and they strangely come out ok.
    I am a web designer and it is crucial for the uploading process to work, and for the graphics to arrive to their destinations correctly, without corruptions.
    At first I thought perhaps I am experiencing a glitch on one of my Adobe programs; Photoshop. This is what I use the most. However I tried working in Illustrator and it produced the same problem. Then I tried doing a screenshot of a website and tried uploading and emailing that image across the web without editing it on any programs or adobe programs and it STILL has a the same problem, and it actually looks worse and is more corrupted.
    I am quite convinced there is something wrong with my Mac, but I am not sure what it is or what to do about it It is incredibly frustrating and hope someone out there know what is wrong, or if it is fixable if I attend to something myself before taking it to a technician.
    Thanks and regards,
    Nancy

    Nancy --
    I'm wondering why you're staying at 10.5.4.
    10.5.8 is the final Leopard, and would be a free update for you.
    If you are on 10.5.8 now, change your specs mentioned in your profile here, the last line of your posts.
    Do you have any photos in iPhoto? Can you upload a photo without graphics breakups?
    How about PDFs? How about something viewed in Preview, not Adobe Reader.
    Have you updated any of your Adobe apps just before this approximate two -week period?
    Have you done any maintenance that has cleared caches? I use YASU (free download) to clean things up about 1-2x a year.
    Message was edited by: ~Bee

  • I have created corrupted files when transfering to new laptop

    Please can anybody assist..
    I've just tried to transfer my library from my desktop onto my laptop, somewhere in the process i have managed to corrupt my files.
    I can still access my ipod on my desktop, but am unable to update it because i'm told that there is not enough free space to hold all of the items in the library.
    Please help, i can't even find a link to email the support team...

    How are you trying to transfer to files. If we know that it might help to figure out what is going wrong.

  • How to create a file links .....

    Hi All!
    I want to achieve following, using the IFS java apis. How can i do that. what classes - methods i can use from ifs. A code snippet will be really helpful.
    Here goes my task of creating links to a file from different folders in repository..........
    To create a file link:
    Select check box to the left of the file or folder you want to display in another folder....
    Click the Edit icon and choose Copy.......
    Navigate to the folder in which you want to create the link....
    Click the Edit icon and choose Paste as links....
    If you want to create a link in more than one location...:
    Navigate to the next folder in which you want to create a link.....
    Click Edit and choose Paste as links.....
    Continue until you have created links in all desired locations.....
    But, I want to achieve above using Java API.
    Your help is appreciated.
    thanks,
    sa pa

    Why not make them one file?
    Dan Smith > adobe community expert
    Flash Helps >
    http://www.smithmediafusion.com/blog/?cat=11
    http://www.dsmith.tv
    "tanktery" <[email protected]> wrote in
    message
    news:fpmrmi$jiq$[email protected]..
    >I created two XML files an XML file A and an XML file B
    and would like to
    >know
    > how to create a link between the two.
    > But in file B I have articles that I would like to
    create links to from
    > the a
    > A file. How do I link 2 XML files and link to
    subsections with in them.
    > any
    > thoughts
    >

  • I'm trying to backup a my harddrive with disk utility but I'm getting an error  Unable to create Backup.dmg" (input/output error). Is there any other way to save my data? I believe my hard drive is failing or corrupt file. I can't boot up. Grey screen

    I'm trying to backup a my hard drive with disk utility but I'm getting an error  Unable to create Backup.dmg" (input/output error). Is there any other way to save my data? I believe my hard drive is failing or corrupt file. I can't boot up. Grey screen and spinning wheel. I've tried everything https://discussions.apple.com/message/20580424#20580424
    any help will be greatly appreciated.

    Check here. Also have you done a TimeMachine back up?
    http://support.apple.com/kb/TS2570

  • IMovie HD creates corrupt db file which not get deleted out of trash

    iMovie HD creates corrupt db file which not get deleted out of trash.
    How to delete this file ?
    Please help me out,
    Thank You.

    Where is what file created? (Do you see it in iMovie or Finder?)
    Which trash, iMovie's or Finder's?

  • HT3831 i tried to update my iphone 4 and i am getting a message that i am getting corrupt files or check settings on phone what do i check

    i am trying to updating my system and when i do it says something about corrupt files or check phone settings does anyone know about this

    If you open it to take out the battery from the iPhone then you forfeit all service for whatever reason from Apple in the future.
    Have you attempt to connect it to your computer and then restore it from iTunes on your computer?

  • Checking the existence of a file b4 creating a file by the same name

    Hi All,
    I hav a scenario where I hav to check for the existence of a file by the same name (<b>XXXFile</b> say). If i don't hav any file by the name <b>XXXFile</b>, then i hav to create a file by the name <b>XXXFile</b> at that location. If it already exists, then i hav to wait till it gets deleted (takes hardly 1 min to get deleted).
    Can any one tell me :
    How to do this without using operating system command?
    And using operating system command?
    Any help wud be appreciated.
    Thnx in Adv
    Anil

    Hi Anil,
    You will i guess have a standard format in which you are going to write the file with a counter or something.
    Whenever you are going to write a file, you can:
    1. Check if there is a file already sent by this name?
    2. If no, then you can send the file at the same time update the name.
    You can do this by creating a ztable in SAP and accessing it through JCO/RFC. You can do this in your module or in the mapping.
    eg. /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    Regards
    Vijaya
    Message was edited by: vijaya kumari

  • Creating TOC corrupts file

    Hi,
    Wondering if anyone has the same issue and found a workaround.
    I spent 3 hours on creating and designing a TOC for my book. All was well and I was very happy. Today I opende the file, and both the file and the backup I created one hour before ending work yesterday didn't open. Corrupt.
    I work with CS5, but I remember I had the same in CS4. The file is doing well until you create/update a Table of Contents.
    The file probably has some corruption that creating a TOC makes Indesign mess up the file for good, but exporting and importing back doesn't help one bit.
    I've tries all the standard answers you can Google for against corrupt files, but can't nail this one. Can't find a decent workaround except for making a backup every five minutes when I'm working on the file, or update the TOC, don't save, but export. So I can never save an up to date TOC.
    Anyone who has had this issue as well: please respond. Thanks. I am on W7/CS5/Dutch.
    PS.
    Indesign feels like the most instable piece of software since Windows 95. (And yes, it crashes on the Mac just as hard.)

    None of the symptoms you describe are in any way usual or "normal" for ANY version of ID. This is probably a system-specific problem such as conflicting software or a bad font, What's your OS?
    Do you get an error message when you try to open this file?

  • System File Checker -Cannot fix corrupt files

    How practical do you consider the various measures to replace / resolve corrupt files are?
    My feeling is that the simplest solution is to do a repair install or clean install of the operating system. This would include where appropriate an In place Upgrade, restore to factory settings or to restore a system image.
    What do you think? 
    Hope this helps, Gerry

    Hi Gerry,
    System File Checker is a utility in Windows that allows users to scan for corruptions in Windows system files and restore corrupted files. OF course, this may not resolve all problem.
    Repair install, clean install, restore to factory etc have their own function on recovering the operating system. It depends on your exact issue.
    For more detailed information, please refer to
    http://windows.microsoft.com/en-in/windows/what-are-system-recovery-options#what-are-system-recovery-options=windows-7
    http://windows.microsoft.com/en-in/windows/installing-reinstalling-windows#1TC=windows-7
    Karen Hu
    TechNet Community Support

  • Keeps randomly disconnecting,cant be restored,cant delete corrupted files!

    Too many problems with my ipod video!!!Its a constant battle to get it working.
    Ive tried to restore it but it sais "firmware update failure. Disk write error."
    I tried deleteing the corrupt files in my temp music folder but it keeps telling me the directory cannot be deleted because its not empty, and when i delete song in the backup folder individually they just reapear!!
      Windows XP  

    *so nobody knows how to fix it?*
    Yes, we do know but you've taken steps to prevent implementation of the fix. You want your flat tire repaired but you refuse to allow the mechanic to jack up the car.
    *apple, im tired of spending countless hours restoring my ipod everytime something goes wrong!*
    Hold on, now. You're blaming Apple for having spent "countless hours" restoring the iPod yet you told me that you don't want to do the restore because you deliberately configured iTunes different from Apple's recommendations. Wow, that's heavy. $300 for an iPod but you won't spend $80 to upgrade your computer so that it can support the iPod.
    Message was edited by: PhillyPhan

  • GB Creating Corrupt Project Files

    Hi. I've been working with GB and GPO (Garritan Personal Orchestra) for a video project. A had a Project open (a fairly large one) and was frequently "saving" to the project on the Mac HD. I have encountered problems with GB crashing and the project files being used becoming corrupted in the past week. But I can't figure out what's causing the problem. This time I saved the project, opened up a track volume control for one track (Out of the 20 or so tracks) and clicked on one point and the big picture in the Software Instrument went black and GB crashed. The Relaunch dialog window came up. At that point, the project was corrupted. I now have two .band files that don't have a thumbnail preview when looking at them in the finder. GB says "Read Error: Illegal format of file. Abort" when I try to open them. Any help on more of what's causing this problem rather than how to fix the corrupted files (Even though that would be fantastic) would be appreciated.
    Thanks
    Lojimek

    Sorry I don't have any insight as to possible causes (do you Lock as many tracks as possible)? but here's HangTime's tutorial on rescuing corrupted files:
    http://www.bulletsandbones.com/GB/Tutorials/RescuingFiles.html

  • Corrupted files with automatic red finder tags! :(

    Hello,
    it's for some time that my mac corrupts files, particularly those videos stored on various hard disk randomly. Each file has a red finder tags and I am not able to open them though I see it size that seems ok...I tried to check hard disk but this not solve problems...
    Sorry for my bad english...
    https://www.dropbox.com/s/qmxoqq650cg09cp/box.jpg?dl=0
    Any suggestions?
    Thanks

    I have today encountered a problem opening old Keynote presentations on my new iMac running Leopard. It cannot open any of the old presentations on my machine because it says they are damaged.
    I also could not open an old Pages file because it says the file is corrupt and there was a .xml missing. I later managed to open this by searching for it directly through the application "Open" command and following the search path. It then gave the usual " This was created by a previous version of Pages..." and the Save as warning, but it did open when I went this route. (I have now saved this document as Pages 08 and all is well).
    There seems to be a bug in the iWork '08 suite when it comes to older documents.

Maybe you are looking for

  • NEW BIOS version for Satellite A200 PSAEC!

    They've posted new Bios updates on the download page! 5.20-WIN : This Bios is NOT compatible for Notebooks with Windows Vista!!! 1.80-WIN : This Bios is ONLY compatible for Notebooks with Windows Vista!!! But I don't really know how to use this. Beca

  • LR2:DNG - PSCS3:'Smart Object' workflow question

    Hello, I've just started working with DNG files exported as Smart Object from LR2 to PSCS3 and I would appreciate some feedback on my experiences thus far. Let us assume that I've made basic corrections to _DSC1190.dng within LR2. I then want to appl

  • Thread Pool in JRT

    Hi All, 1) the first question is what is the recommended way to allocate thread poll in rt system?? 2) what is the best way to do: -if my mission take a long time can i just suspend the thread and than resume it again (is it possible at all??) or the

  • HRMD_A Delimiting Date Update Mode

    Hello all, For creating a Employ master i have used HRMD_A IDOC.It is successfully creating it. But when i try to Update the Employ Master :          For creating the existing infotype with the new evaluation period.It is overwriting the existing rec

  • Reading a scale value for a condition

    I have a condition on VK12 with a scale value on it.  It's a perception minimum for a tax. I have a SD formula (937) on VOFM - Formulas - Condition Value.  There in some cases I want to check if a sum stored in gkmov is greater than this perception m