Re: ExtAudioFileWriteAsync problem,empty file
Re: ExtAudioFileWriteAsync problem,empty file
- Subject: Re: ExtAudioFileWriteAsync problem,empty file
- From: William Stewart <email@hidden>
- Date: Mon, 6 Aug 2007 12:20:47 -0700
2 points:
(1) ExtAudioFile already allows you to specify a client data format
that you can use - so you don't have to create a converter yourself
to do that extra work - just set the client format to the format that
you have the data in already
(2) The WriteAsync version of this (versus ExtAudioFileWrite) will
already have another thread internally that it is using to marshall
data and write it to disk. In AULab's recording function, we use the
ExtAudioFileWriteAsync to do the recording, and we're just syphoning
the data to record directly off the I/O thread - just grab the data
from the graph (using the RenderNotify - in the post stage call) and
push that buffer list directly to the ExtAF WriteAsync
So, I know this doesn't answer your question, but it might help you...
The first thing I would check in your code below is to make sure that
you are actually pushing packets of audio - are you sure that
numPackets is > 0?
Bill
On 03/08/2007, at 9:15 AM, sheen mac wrote:
Hi All,
I tried to record data with in fixed interval using a NSTimer .At the
interval time I fetch the value from the ringbuffer and convert it
into
desired format.After that I record it into file.But after the file
disposal,
the file size was zero.I attached the code here.I used the same
client data format and file format of the recordAudioToFile code.
Kindly help me.
Thanks In Advance,
Sheen
- (void)audioRecordTimer
{
AudioBufferList *outBuffer = NULL;
OSStatus err = noErr;
outBuffer = objRecorder->RenderToBuffer(&err);
bcopy(outBuffer->mBuffers[0].mData,fAudioIPBuffer->mBuffers
[0].mData,1000);
UInt32 numPackets = fAudioOPBuffer->mBuffers
[0].mDataByteSize / fOutputFormat.mBytesPerPacket;
err = AudioConverterFillComplexBuffer
(fConverter,ReConverterProc,self, &numPackets,fAudioOPBuffer, NULL);
if(err != noErr)
fprintf(stderr, "AudioConverterFillComplexBuffer FAILED! ");
err = ExtAudioFileWriteAsync
(fOutputAudioFile,numPackets,fAudioOPBuffer);
if(err != noErr)
fprintf(stderr, "ExtAudioFileWriteAsync FAILED!
'%-4.4s'\n", formatID);
}
Ready for the edge of your seat? Check out tonight's top picks on
Yahoo! TV.
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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