Re: Streaming Audio - AudioFileStream, CFReadStreamRead and AudioQueue
Re: Streaming Audio - AudioFileStream, CFReadStreamRead and AudioQueue
- Subject: Re: Streaming Audio - AudioFileStream, CFReadStreamRead and AudioQueue
- From: Erik Aigner <email@hidden>
- Date: Wed, 30 Jul 2008 14:16:43 +0200
Your problem is that your allocating the buffer but not writing any data to it.
void audioFileStream_Packets (void *inClientData, UInt32 inNumberBytes, UInt32 inNumberPackets, const void *inInputData, AudioStreamPacketDescription *inPacketDescs) {
customData.mNumPackets = inNumberPackets; customData.mPacketDescs = inPacketDescs;
AudioQueueBufferRef outBuffer; AudioQueueAllocateBuffer(customData.mQueue, inNumberBytes, &outBuffer); AudioOutputCallBack(&customData, customData.mQueue, outBuffer);
}
You don't write the needed const void *inInputData to your buffer. I don't know how to write data to an AudioQueue that's in memory (only AudioFileReadPackets which does this for a file), however i found a method that works for me.
Save the audiodata continuously to a temporary file and use the AudioQueue sample project apple provides to read from that file (while the other process is appending data to its end).
This works pretty nice |
_______________________________________________
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