Re: Audio Input Queue on iPhone
Re: Audio Input Queue on iPhone
- Subject: Re: Audio Input Queue on iPhone
- From: "Inca R" <email@hidden>
- Date: Wed, 24 Sep 2008 07:04:30 +0300
Hi;
Thanks for the answer.
I check the result of AudioQueueNewInput and it was 0.
I did what you suggest, zeroing the ASBD fields for the queue to fill them, but I got same results.
Callback is arriving every 60 ~ 70 nanos and at 1/2 second ( this happens every 1/2 second ) the callback is delayed
1/2 second.
Can you pls provide a valid ASBD for uLaw ?
Thanks
Inca
On Wed, Sep 24, 2008 at 5:00 AM, William Stewart
<email@hidden> wrote:
Check the result code returned by AudioQueueNewInput - the ASBD you have for this is not correct - you could specify the ASBD with everything set to zero except for formatID, num channels and sample rate, and the AQ will fill this out for you
Bill
On Sep 23, 2008, at 6:24 AM, Inca R wrote:
Hi;
I'm trying to get ulaw samples at 20 millis from the iPhone mic, but this seems impossible.
The audioFormat definition is:
audioFormat.mSampleRate = 8000.0;
audioFormat.mFormatID = kAudioFormatUlaw;
audioFormat.mFormatFlags = 0;
audioFormat.mFramesPerPacket = 1;
audioFormat.mChannelsPerFrame = 1;
audioFormat.mBitsPerChannel = 8;
audioFormat.mBytesPerPacket = 1;
audioFormat.mBytesPerFrame = 1;
The audio input queue creation:
AudioQueueNewInput (
&audioFormat,
recordingCallback,
mydata, // userData
NULL, // run loop
kCFRunLoopCommonModes,// run loop mode
0, // flags
&queueObject
);
I also create 3 buffers of 160 bytes ( 20 millis ) each and enqueue them into the previously created Audio Input Queue.
Everything works ok, BUT, there is a problem on the frequency I get called to my AudioQueueInputCallback function ( recordingCallback).
It was expected to be every 20 millis. But not. The Callback get called
every 30 to 70 nanoseconds but every 1/2 second the callback is called with a 1/2~1 second delay.
Anybody knows the logic behind this behavior ?
I'm missing any configuration or parameter ????
another issue is that the documentation says that for CBR codecs the last two parameters
of the callback function are set to NULL. But in my example I get called with the last one set to NULL
but the other one with the number of samples returned on the buffer.
This is correct ???
Thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
This email sent to email@hidden
_______________________________________________
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