--- Gad Hayisraeli gad@syete.co.il wrote:
i need to be able to jump to some position in song (after receiving interrupt), but not in pieces of 26 ms (1 frame), but within each frame also, in accuracy of less than 5 ms. also, the latency between getting the interrupt request and the jump itself will have to be even less than that.
To achieve sub 5ms accuracy, you would have to decode the whole of the frame containing the desired seek destination (OK maybe just a granule - ie 1/2 of a frame - but this would require significant changes to the decoder internals) and then discard samples up to the desired start point. As you rightly say, this increases latency....
Unfortunately, there isn't much that can be done to improve latency (without significantly reducing quality in the first frame decoded) in terms of software tweaks to the decoder. The operation of the winamp plugin as already described by Rob in this thread should give an idea of the complexity of the steps involved in a seek - but this is imposed by the MP3 format itself rather than the decoder implementation.
The only possible way to improve latency is therefore to increase the amount of cpu power... For example, a 600MHz Pentium III can decode individual frames in approx 0.8 ms. Therefore even if 2 full frames must be decoded before any audio is available, the latency on this platform would be around 1.6 ms. A 1GHz x86 cpu would reduce it to under 1ms etc.
Unfortunately, if you have limited cpu bandwidth, this probably isn't good news :-(
What is your application ? Why do you have such tight seek accuracy/latency requirements ??
Andre --
____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie