Re: iOS SDK: ExtAudioFileSeek
Re: iOS SDK: ExtAudioFileSeek
- Subject: Re: iOS SDK: ExtAudioFileSeek
- From: tahome izwah <email@hidden>
- Date: Tue, 29 Nov 2011 08:38:12 +0100
The ISO / IEC 11172-3 standard for instance. Here's a summary (from
http://bit.ly/tNGfcK):
"Decoding of MP3 audio is carefully defined in the ISO standard [1].
Each frame is made up of 1152 samples and there is always a header
attached to each of the frames associated in the MP3 file. Content in
the header and side information for a particular frame is necessary so
that decoding is done correctly.
The first and foremost thing in the decoding procedure is the
synchronisation of the decoder to the incoming bitstream.
Synchronisation is the process of finding the position of the first
header and the subsequent ones. Once this is done, the organisation of
the encoded data is completely known and the decoding procedure can be
performed smoothly. The block diagram in Figure 3 and flow chart in
Figure 4 gives an idea on the procedure.
> [Figure 3: Basic sketch of a decoder]
Frame unpacking constitutes finding the bitstream header, decoding
side information, decoding scale factors and decoding the Huffman
data. Reconstruction block constitutes requantizing and reordering the
spectrum. Inverse mapping constitutes joint stereo processing if
applicable, alias reduction, synthesis via IMDCT and polyphase filter
bank, and out comes the PCM samples."
Doing this fron scratch for each block (because you're stepping
backwards through the file) is quite a CPU intense process. If you
decode larger blocks most of the bookkeeping needs only to be done
once so it will be more efficient. The larger your blocks, the better.
HTH
--th
2011/11/28 Art Gillespie <email@hidden>:
> Ah, thanks. Where does one go to get smart about such things? Is there a
> block size that makes sense for decoding the mp3 to LPCM in chunks rather
> than decoding the whole file serially before playback?
>
> On Mon, Nov 28, 2011 at 1:20 PM, tahome izwah <email@hidden> wrote:
>>
>> Decode to PCM and play in reverse. It might be possible to do it "in
>> place" with a compressed file but that would be horribly inefficient
>> (of course depending on your audio block size per decode). MP3
>> requires previous transform frames to decode the current one so the
>> decoder will end up seeking in your file quite a bit.
>>
>> --th
>>
>>
>> 2011/11/28 Art Gillespie <email@hidden>:
>> > I'm trying to play a file in reverse using ExtAudioFileSeek and I'm
>> > seeing
>> > some strange behavior when the file in question is an mp3.
>> > Code here:
>> > https://gist.github.com/1401245
>> > With an LPCM or aac file, the reverse playback sounds as I would expect,
>> > but
>> > with an mp3 I get some strange behavior. Here's the audio output
>> > http://www.tapsquare.com/art/extaudiofilehatesus/output.wav
>> > I can't find a pattern to the discontinuities, though there does appear
>> > to
>> > be a weird attenuation (windowing?) just before each bit of zero
>> > samples.
>> > The only sensible thing I notice is that the behavior is deterministic:
>> > Subsequent passes generate the same discontinuities.
>> > Any suggestions of how to fix this or work around it greatly
>> > appreciated.
>> > Thanks,
>> > Art
>> > --
>> > art gillespie
>> > tapsquare, llc
>> > p. 520.344.0902
>> > skype. artgillespie
>> > e. email@hidden
>> >
>> >
>> > _______________________________________________
>> > 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
>> >
>> >
>> _______________________________________________
>> 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
>
>
>
> --
> art gillespie
> tapsquare, llc
> p. 520.344.0902
> skype. artgillespie
> e. email@hidden
>
>
_______________________________________________
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