Re: AudioConverterFillComplexBuffer and '!buf' error
Re: AudioConverterFillComplexBuffer and '!buf' error
- Subject: Re: AudioConverterFillComplexBuffer and '!buf' error
- From: William Stewart <email@hidden>
- Date: Thu, 8 Nov 2007 11:23:42 -0800
The AudioFile API doesn't really deal that well with streams of audio.
In Leopard we've provided a new API for this situation:
AudioFileStreaming. So, that would be ideally suited to your needs
(but isn't available for a Tiger system).
On Nov 8, 2007, at 5:29 AM, Damien Chavarria wrote:
Hi,
Thank you very much you put me on the right tack. I was indeed only
passing raw data to the converter by a fixed amount that did not
correspond to the packet size or anything, I should have paid closer
attention to the samples. I am now using the AudioFile api to read
the requested number of packets and get proper packet descriptions
form the mp3 stream. The one thing though is that my mp3 stream is
contained in an AVI file that I am still downloading (and therefore
progressively playing) at the time the program runs.
So I am using AudioFileOpenWithCallbacks to open my audio stream
from memory and provide read and get size functions. Since I don't
really know the size of my audio stream in advance and since the
whole stream isn't available, I return a big number from the get
size method. This might not be the best but I couldn't figure out a
way to use the AudioFile API another way, since it seems to want to
look at the end of the stream for a ID3 tag (which I fake right
now). Maybe there is another API to read audio packets from a stream
(as opposed to a file of fixed length) ?
Anyway, this seems to work as the Open call succeeds and I'm able to
read several packets and decode some of the mp3 stream to PCM using
my audio converter. Now, the problem is I am getting a crash though
and it does not always happens at the same 'time' in the mp3 stream
but it always happen at same spot inside MPEGAudioFile::ReadPackets
from within the time I call AudioFileReadPackets() to read packets.
I'm not sure why the crash does not always happen at the same time,
however it happens consistently and when it does, I can see that the
packet number (of which I keep count to call AudioFileReadPackets)
is always either 1023, 2047 or 4095 - which is odly a power of two
minus 1.
That is odd. If you can provide more details and code in a bug report,
we can have a look at it. (http://bugreporter.apple.com)
Bill
_______________________________________________
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