Re: AudioConverter
Re: AudioConverter
- Subject: Re: AudioConverter
- From: Doug Wyatt <email@hidden>
- Date: Mon, 18 Nov 2002 15:14:33 +0100
This is a FAQ ...
Sorry but you must use AudioConverterFillBuffer instead of
AudioConverterConvertBuffer when there is a sample rate conversion.
ConvertBuffer only works when the input size is not only known but
constant. The kAudioConverterPropertyCalculateOutputBufferSize
property returns an approximation, but the algorithm will consume
slightly varying amounts...
Doug
On Monday, Nov 18, 2002, at 10:58 Europe/Berlin, Martin Hairer wrote:
Hi,
I think a similar issue has already been raised on this list, but I
couldn't find
it and I'm not sure it was really resolved.
The problem I am running into is that of changing the sampling rate of
a piece
of sound using an AudioConverter. When I use
AudioConverterConvertBuffer
with a comfortable value for ioOutputDataSize, I always get a
kAudioConverterErr_InvalidInputSize error, which probably means that
the
AudioConverter would like to fill up my output buffer completely but
doesn't have
enough data in the input buffer. Why doesn't it simply fill up as much
as possible
and writes the achieved size in the ioOutputDataSize variable?
In other words, is there a simple way to tell an AudioConverter to
convert some buffer
of input data into a (big) output buffer and to tell me how many bytes
were actually
written to the output buffer? I must have overlooked something
obvious, since this sounds
to me like one of the main uses for an AudioConverter...
I've already tried to call
kAudioConverterPropertyCalculateOutputBufferSize prior
to AudioConverterConvertBuffer, but it doesn't work either, since it
seems to always
return some minimal (or maximal) size for the buffer, but not the
precise size...
Thanks for any insight,
Martin
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
--
Doug Wyatt
work: email@hidden (CoreAudio)
personal: email@hidden
http://www.sonosphere.com
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.