Thoughts/ideas on decompressing parts of an MP3 stream
Thoughts/ideas on decompressing parts of an MP3 stream
- Subject: Thoughts/ideas on decompressing parts of an MP3 stream
- From: Mattias Arrelid <email@hidden>
- Date: Wed, 14 Mar 2007 16:58:55 +0100
Hi everyone,
Below follows some questions regarding practices on how to decompress
parts of an MP3 stream that is received over a network connection.
Before I go on with that, I want to tell you that I'm relatively new
to Core Audio - I've been playing with the samples in the SDK folder,
and I've been reading the documentation and I consider myself
somewhat comfortable with the terminology and the conceptual design
of Core Audio.
Now over to my problem... I'm working with an application that
receives an MP3 stream over a network connection. Received data
should be decompressed as it arrives - let's say that I receive a
part of a file containing fifty (50) MP3 frames, then I want to
decompress these frames to the destination format used by the device
playing the sound. This should ALWAYS be done, even if the device
that's playing sound is paused for the moment (since I want the data
unpacked and ready to consume, and don't want the audio unit callback
to have to call the converter callback). When the device is told to
play, it should consume data from the already decompressed data (I'm
saving this uncompressed data in a separate buffer which I tell the
audio unit's render callback to read from).
Something goes wrong along the way though...
As of now, I got two buffers. One containing compressed data, and an
empty one that should contain decompressed data. What I would like to
do is to tell the decompressor that "here, I allocated some memory
where you can put decompressed data, decompress as much data you can
(the fifty MP3 frames might not fit, but decompress as many as
possible) and put it here!". The problem is that I can't see how to
do this, since I can't figure out HOW much of the source buffer that
was processed for each call... How many frames should I ask the
converter to convert (I guess this depends on the size of my buffer
that should contain the uncompressed data)?
Any suggestions, tips or other ideas on how I should go on from here?
Thanks in advance
Mattias
_______________________________________________
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