[Scummvm-devel] Idea: IndexedMp3AudioStream

Norbert Lange lange at chello.at
Fri Oct 8 13:41:48 CEST 2010



Am 08.10.2010, 12:55 Uhr, schrieb yotam barnoy <yotambarnoy at gmail.com>:

>> ...but we also lose the ability to fine-tune how many data points we  
>> have. XING provides exactly 100 data points, whereas the ID3 solution  
>> can provide us with many more. Considering that we're mainly planning  
>> this for small, embedded devices with limited processing power, that  
>> extra bit of flexibility *might* be nice to have.
>>
>> Michael
>>
0x100 datapoints =)
And between them you could do an linear approximation which should be good  
enough for background music and speech.
It might be noticeable out of sync if its supposed to be played together  
with a video-stream tough.
There was an solution by Fraunhofer aswell, with a variable number of  
seekpoints, I`d need to google it up.

>
> That's where I also have my doubts. The question is how precise we
> need to be. My guess is, since Xing obviates the need to seek to the
> end to find the total time, even if it gets us in the very rough
> ballpark when we seek it should be good enough to make seeking
> unnoticeable on most devices.
>
> If it's not good enough, we could always add Id3 tag support later. As
> of right now, I'm going to try using Xing.
>
> Yotam
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> Scummvm-devel mailing list
> Scummvm-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scummvm-devel

Given that most encoders add Xing/LAME tags it should be the right way to  
do. But instead of adding support yourself, using an library that already  
supports it would be an option (mpg123 library for example).
compared to the now used MAD library you would get:
* support for exact size (Xing tag)
* support for better seeking (Xing tag and other less common ways like  
Fraunhofer`s), interpolating between seekpoints. I think theres an option  
for sample-accurate seeking aswell, scanning from the nearest seekpoint.
* support for delay/padding tags (Xing/Lame). (the first ~512 samples of  
an MP3 are silence added by the encoder, if you know the exact amount you  
can skip it, killing the short delay if you have 1 mp3 per spoken line)
* not restricted to integer-only math (but this can be enabled  
optionally), which should be faster on any CPU with a solid FPU.

I`d have asked about changing to mpg123 libs some time ago, but I figured  
it would be annoying to have to add the library for all platforms... and I  
likely wont be able to finish it in timely manner. But I think it could be  
helpful if you know about other options than implementing the features on  
top of the (IMHO unappealing) MAD-Library yourself.

Norbert




More information about the Scummvm-devel mailing list