摘要 |
A method for estimating an audio length of an audio file in an audio player is provided. First, the method generates a predicted audio length based on the average bit rate of some selected audio frames in the audio file, and initializes an adjustable audio length by the predicted audio length. Then, in the process of playing each audio frame of the audio file, the method continuously calculates a latest reference audio length. If the variation between the latest reference audio length and the previous reference audio length is smaller than a predetermined threshold, the method will adjust the adjustable audio length according to the latest reference audio length. Finally, based on the ratio of the played data amount to the total data amount of the audio file, an estimated audio length can be acquired between the adjustable audio length and the reference audio length.
|