Re: Empty file created with ExtAudioFileWrite
Re: Empty file created with ExtAudioFileWrite
- Subject: Re: Empty file created with ExtAudioFileWrite
- From: William Stewart <email@hidden>
- Date: Mon, 17 Jul 2006 14:57:00 -0700
The number of frames is the number of sample frames you are providing
to the write call. That is, instead of provide a size of the
outputData in bytes (which is contained outputData in any case), you
are providing a size of the output data in number of sample frames
On 17/07/2006, at 11:46 AM, Lee Falin wrote:
Ok, now I have tried the following:
unsigned int numberOfFrames = sizeof(outputData) / 4;
Given that outputData is a pointer, and sizeof(ptr) is 4, then how
many frames are you specifying?
OSErr test2 = ExtAudioFileWrite(outRef, numberOfFrames,outputData);
Gives same empty file
I also tried:
OSErr test2 = ExtAudioFileWrite(outRef,MTAudioBufferListFrameCount
(outputData) ,outputData);
Which gives a file with data, but always the same garbled spike.
Then that sounds like there is a bug in the MT frame count call - I
presume that it looks at the data byte size of the buffers, but what
format of the buffer is it using to determine this?
I have also tried setting the client input format via:
AudioStreamBasicDescription indesc;
indesc.mSampleRate = 44100;
indesc.mFormatID = kAudioFormatLinearPCM;
ExtAudioFileSetProperty
(outRef,kExtAudioFileProperty_ClientDataFormat,sizeof
(AudioStreamBasicDescription),&indesc);
Which doesn't seem to have an effect under either scenario. Is my
problem that I am recording the data with MTCoreAudio and then
trying to record it with the regular Core Audio API?
No - you aren't telling the Write call how many frames of audio data
are contained in the AudioBufferList you are providing it.
The call is similar in spirit to the AudioUnitRender call - in that
call a client calls an AU to render data and provides an
AudioBufferList and a number of frames. In normal usage (and the same
*probably* applies here as well), the number of frames is the data
byte size of the audio data / sizeof(float).
Bill
On Jul 17, 2006, at 2:00 PM, Doug Wyatt wrote:
On Jul 15, 2006, at 13:54 , Lee Falin wrote:
Can someone tell me what I am missing? I realize that I'm
probably doing this wrong:
Yes.
OSErr test2 = ExtAudioFileWrite(outRef,sizeof
(outputData),outputData);
But I wasn't sure whre to get the number of frames from.
You know the number of bytes, and since it's presumably PCM, you
know the number of bytes per frame...
--
Doug Wyatt
Core Audio, Apple
_______________________________________________
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