Re: Question about the AudioConverterFillComplexBuffer callback function
Re: Question about the AudioConverterFillComplexBuffer callback function
- Subject: Re: Question about the AudioConverterFillComplexBuffer callback function
- From: Fredrik <email@hidden>
- Date: Tue, 11 May 2010 13:02:08 +0200
>
>> I have been looking at the new example code, FileConverter and noticed that the callback does reading directly from the file. In my case I have already read from my file into a buffer. Is it possible to just supply the buffer to the callback function instead?
>
> You would put the buffer pointer into the AudioBufferList.
>
> outOutputData->mBuffers[0].mData = myPointer;
> outOutputData->mBuffers[0].mDataByteSize = .. the size in bytes of the data pointed to by myPointer ..
> ioOutputDataPacketSize = .. number of packets (or frames of LPCM) of audio pointed to by myPointer.
>
>>
>> I also noticed that the struct passed to the example callback function contains a AudioStreamBasicDescription is it possible to do this without it, since I have created a converter with this as arguments?
>
> The inInputDataProcUserData pointer can point to absolutely anything you want.
>
Thank you, that's great. In the callback function itself all I have to do is to move packets from the input data buffer to the output buffer and advance the pointer right. How can I find out the ideal or reasonable amount of packets to move in the callback? I saw in the documentation that a small amount will cause the function to be called more frequently. _______________________________________________
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