• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Streaming Graph to file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Streaming Graph to file


  • Subject: Re: Streaming Graph to file
  • From: Brian Whitman <email@hidden>
  • Date: Fri, 14 Apr 2006 13:07:22 -0400

Like others earlier last month I am also trying to write a graph out to disk with ExtAudioFile. I keep getting a EXC_BAD_ACCESS on the writes, the debugger saying "Cannot access memory at 0x4." The code looks somewhat lke:

outputFormat = AudioStreamBasicDescription: 2 ch, 44100 Hz, 'lpcm' (0x0000000E) 16-bit big-endian signed integer

err = ExtAudioFileCreateNew (&dirFSRef, cfName, fileType, &outputFormat, NULL, &of); (returns no error)

clientFormat = AudioStreamBasicDescription: 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved (this is the graph's ASBD, which plays fine otherwise)

err = ExtAudioFileSetProperty(of, kExtAudioFileProperty_ClientDataFormat, size, &clientFormat); (returns no error)
err = ExtAudioFileWriteAsync(of, 0, NULL); // priming, returns no error


Set up the graph, etc.

To the final mixer AU i add a render notify and pass it a ref to my Obj-C class:
AudioUnitAddRenderNotify(audioUnits->mixerAU, renderMixerProc, (void*) def);


Start the graph. In the render proc I do:
ExtAudioFileWriteAsync(def->of, inNumberFrames, ioData);

Which is where the bad access is, on the very first frame (I've verified that the ABL has data and inNumberFrames is 512.)



On Mar 6, 2006, at 5:40 AM, Karim Morsy wrote:
just a hint in case you haven't already done so... use ExtAudioFileWriteAsync instead of ExtAudioFileWrite. It is much easier to use, as it performs the write for you on an internal thread very efficiently and you don't have to worry about managing buffers and threads.
before starting your audio capture you should initialize the async write: ExtAudioFileWriteAsync(outfile, 0, NULL).

_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Streaming Graph to file
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: midi note on for beginner
  • Next by Date: Re: Doubts
  • Previous by thread: Re: SoundConverterGetInfo & SoundComponentGetInfo
  • Next by thread: Re: Streaming Graph to file
  • Index(es):
    • Date
    • Thread