Re: How to Use AudioQueueOfflineRender?
Re: How to Use AudioQueueOfflineRender?
- Subject: Re: How to Use AudioQueueOfflineRender?
- From: William Stewart <email@hidden>
- Date: Mon, 21 Jul 2008 19:19:15 -0700
On Jul 21, 2008, at 6:56 PM, William Stewart wrote:
I would not use a channel bitmap in the ACL, but rather use one of
the predefined labels (mono is fine).
So, the ACL will be:
kAudioChannelLayoutTag_Mono | 1; // the 1 here is for one channel
0, // no bitmap
0 // no channel descs
I don't know what the FillOutASBD.. guy is doing, but I think that
will be the problem - try using CAStreamBasicDescription from the CA
Examples
Bill
On Jul 21, 2008, at 10:44 AM, Louis Valentine wrote:
Does anyone have experience using the AudioQueue :
AudioQueueOfflineRender() function? The documentation is sorely
lacking on the exact method needed to use this function.
What I am trying to do is convert a sound file that is currently in
ima4 ADPCM format into a buffer of regular linear PCM data. I am
able to load and play the sound using an Audio Queue, and it works
fine. However, I don't want to play the sound, I want to render it
into a buffer instead. So what I have tried to do is replace the
AudioQueueStart() call with a call to
AudioQueueSetOfflineRenderFormat() to fill an output buffer with
LPCM, mono, 16-bit data with something like this:
-----------------
struct AudioChannelLayout layout =
{
kAudioChannelLayoutTag_Mono |
kAudioChannelLayoutTag_UseChannelBitmap,
kAudioChannelBit_Center,
0,
NULL
};
AudioStreamBasicDescription streamDesc;
FillOutASBDForLPCM(streamDesc, 44100, 1, 16, 16, false, false);
AudioQueueSetOfflineRenderFormat(audioQueue, &streamDesc, &layout);
-----------------
Everything seems to work, since all the functions return the proper
result code, and the audio queue callback function is called so it
seems like the buffer is being processed, but no matter when I call
AudioQueueOfflineRender(), the output buffer that I specify is
always full of empty data. I've tried calling
AudioQueueOfflineRender() right after calling
AudioQueueOfflineRenderFormat() and also tried calling it during
the callback function, but in both cases the output data is empty,
although it is the correct size so I end up with 2 seconds of
silence in my output buffer.
I did notice a post to this mailing list that seemed to be talking
about the same issue:
http://lists.apple.com/archives/Coreaudio-api/2008/Feb/msg00126.html
He says that he called AudioQueueOfflineRender() during a "render
callback" and it worked. How do you receieve a render callback
(assuming this is different the the regular audio queue callback)?
If anyone has any tips or example code on how to properly make use
of the AudioQueueOfflineRender() function, I'd greatly appreciate
it. Thanks!
-Louis
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@apple.com
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