Saturday, 15 June 2013

ios - Failed to setup audio file in apple sample code "AVCaptureToAudioUnit" -


I am unfamiliar with Objective-C and audioUnit I

I want to make an iOS app Some audio can save audio signal through the translation effect which makes sound in the device. So now I am trying to study the apple code sample of "AVCAPTRUAUDO1UIT"

(Build with Xcode 6.1 and simulator iPhone 5.)

But below error Highlighted

  AudioStreamBasicDescription: 0 ch, 0 Hz, 'LPCM' (0x0000000E) 16-bit signed integer 2015/03/17 13: 44: 56.589 AVCaptureToAudioUnit [1462: 151,210] ] Failed to setup audio file! (29,759)  

Under these logs

written in the method of CaptureSessionController.mm
  - (zero) startRecording {if (! Self.isRecording) {OSErr = KAudioFileUnspecifiedError; @Synchronize (self) {if you start recording by creating an ExtAudioFile and configuring it with sample rate and channel layout as current sample buffer * / // recording format audio file only CAStreamBasicDescription recordingFormat (currentInputASBD) .mSampleRate, currentInputASBD.mChannelsPerFrame, CAStreamBasicDescription :: kPCMFormatInt16, true), recording format.mAformatflag | = KAudioFormatFlagIsBigEndian; NSLog (@ "Recording Audio Format:"); RecordingFormat.Print (); Animate = ExtAudioFileCreateWithURL (_outputFile, kAudioFileAIFFType, and recordingFormat, currentRecordingChannelLayout, kAudioFileFlags_EraseFile, & ExtAudioFile); If (noErr! = Mistake) {ifEnter (Extend Extensions) = ExtAudioFileDispose (if noArr ==am) // Client Format Delay Unit is an output format from Un ExtAudioFileSetProperty (; graphOutputASBD extAudioFile, kExtAudioFileProperty_ClientDataFormat, sizeof (graphOutputASBD)), ExtAudioFile); ExtAudioFile = NULL; }}} // @ Synchronized if (noErr == mistake) {self.recording = yes; NSLog (@ "Recording On"); } Else {NSLog ("Failed to setup the audio file! (% Ld)", (long) mistake); }}}  

It seems that the clearance of "currentInputASBD" does not work, but I could not find a solution for myself. If someone knows how to fix this issue and share it, I would highly appreciate it.

Best regards.

dubryu

  audiostreamBasicDescription: 0 ch, 0h, 'LPCM' (0x0000000E) The 16-bit signed integer  

One problem is that you have not specified number-of-channel (see 0 ch ) then You need to specify it.

You should look something like this:

  AudioStreamBasic Description: 1 CR, 44100 Hz, 'LPCM' (0x0000000 E) 16-bit integer signature  

No comments:

Post a Comment