Re: Streaming Graph to file
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