Audio Input Queue on iPhone
Audio Input Queue on iPhone
- Subject: Audio Input Queue on iPhone
- From: "Inca R" <email@hidden>
- Date: Tue, 23 Sep 2008 16:24:01 +0300
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)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden