EZAudio icon indicating copy to clipboard operation
EZAudio copied to clipboard

Recorder failed to get total frames. (-50) crash on recording audio

Open rbarbish opened this issue 8 years ago • 12 comments

I receive a crash when attempting to record audio on my iPhone 6 w/ iOS9. Strangely enough, the crash does not occur via the iOS9 iPhone6 simulator. The crash occurs after I stop fetching audio from the microphone and close the audio file. Anyone else receiving this crash?

Thanks

rbarbish avatar Sep 17 '15 19:09 rbarbish

I'm running into this too and it's a major roadblock. Happening on iOS 9 iPad Air 2. Haven't been able to track down the cause yet.

Vortec4800 avatar Sep 22 '15 16:09 Vortec4800

I was able to fix my problem by releasing (setting to nil in my case) my recorder instance immediately after closing the file. It seems like something was trying to calculate the current recorder time after the file closed which caused the crash. Maybe that would help you?

Vortec4800 avatar Sep 22 '15 17:09 Vortec4800

Thanks @Vortec4800 , I'll try that and post the results. @syedhali are you in the process of looking into EZAudio's iOS9 compatibility? I haven't seen a release in a while and I'd just like to know that support is still being generated for this framework on the latest iOS versions and devices.

Thanks - Ross

rbarbish avatar Sep 22 '15 17:09 rbarbish

More or less, I was going through and updating all the Pods in my project and EZAudio was one of them. So far I haven't found any incompatibility issues, but I really only use the recorder and plot view so there may be issues elsewhere that I haven't seen.

Vortec4800 avatar Sep 22 '15 18:09 Vortec4800

Hm interesting, sorry to hear it's crashing. I just updated all my devices to iOS 9 today so I'll test out the examples tonight and see if I can reproduce.

syedhali avatar Sep 22 '15 18:09 syedhali

Hi, this happens for me as well.

tmspzz avatar Oct 02 '15 14:10 tmspzz

having the same problem but it seems to be an edge case. Using microphone and recorder.

Steveybrown avatar Oct 06 '15 21:10 Steveybrown

I had the same problem because I was stop fetching audio and stop the recording before the recorder had updated last current time, so I set a flag, recordingShouldStopRecording and in recorderUpdatedCurrentTime check and rally stopFeching audio and recording

  func recorderUpdatedCurrentTime(recorder:EZRecorder){
    NSOperationQueue.mainQueue().addOperationWithBlock { () -> Void in

        self.recordButton.progressStatus = CGFloat(recorder.duration / 30.0)
        if self.shouldStopRecording{
            self.microphone.stopFetchingAudio()

            self.recorder.closeAudioFile()
            self.shouldStopRecording = false
            self.recordButton.progressStatus = 1.0

        }

    }
   }

Charlisim avatar Nov 15 '15 09:11 Charlisim

having the same problem on ios 8 also with version 1.1.5

amitshelgaonkar avatar Feb 02 '16 13:02 amitshelgaonkar

Any update here? We are also waiting to get this fixed asap, as it is affecting lot of users.

Mindbowser avatar Feb 06 '16 14:02 Mindbowser

Where are you stopping fetching audio and close the audio file? Since I moved the code that stops audio to EZMicrophoneDelegate there are no crashes func microphone(microphone: EZMicrophone!, hasBufferList bufferList: UnsafeMutablePointer<AudioBufferList>, withBufferSize bufferSize: UInt32, withNumberOfChannels numberOfChannels: UInt32)

After appending data from buffer to the recorder I stop the recording and close the file.

Also you need to know that there is a method(not well documented) to choose if there is an error in the recording the app should crash or not.

EZAudioUtilities.setShouldExitOnCheckResultFail(false), by default is set to true

Charlisim avatar Feb 06 '16 17:02 Charlisim

i meet the same problem.You can try this in the function recorderUpdatedCurrentTime(recorder: EZRecorder!)

func recorderUpdatedCurrentTime(recorder: EZRecorder!) { var formarredCurrentTime:String? formarredCurrentTime = recorder.formattedCurrentTime dispatch_async(dispatch_get_main_queue()) { self.timeLabel.text = formarredCurrentTime

    }

}

i don't meet the problem anymore but i don't know why it can solve the problem. I think maybe it is associated with thread. if anynoe knows please tell me.

imphila avatar Apr 21 '16 18:04 imphila