你先播放一定大小的文件,记下他的时间,然后在程序中取得他的大小,计算出他的时间!没有现成的东东了

解决方案 »

  1.   

    下面是我从一个老外哪儿问来的
    MP3:  1. Divide the file size by the bitrate (this is only correct for constant bitrate files), or2. Multiply the playing time of one frame by the number of frames (obtained from, e.g. a VBR header), or3. Sum the playing time of every frame by scanning the frame headers in the entire file.The playing time of one frame can be determined by dividing the number of samples in the frame by the sampling frequency. For Layer III (only), there are 1152 samples per frame at 48000, 44100, and 32000 Hz, and 576 samples per frame at all other sampling frequencies.(1) is the simplest method but is not accurate for VBR files.
    (2) requires that the file have some kind of VBR header.
    (3) is the most accurate and robust method but is also the slowest.
    mp3的帧格式可以到www.wavecn.com去看看