一般的 CBR 格式的 MP3 文件可以用 TMediaPlayer 的 Length 屬性正確取得;但是對於 VBR 格式的 MP3 取得的時間與正確的時間相比較長了 1-2 分鐘!

解决方案 »

  1.   

    但是 Winamp 和 Foobar2000 這些播放器可以正確取得時間呢。
      

  2.   

    我不知道你用的Winamp是什么版本我的是2.80版本的。在播放VBR模式的MP3时,他的播放时间是(根据当前的码流和文件大小)一直在变化的。
      

  3.   

    >>没有文件头
    这个好象不太正确把?
      

  4.   

    在國外的論壇上,一老外也是說要按frame來算,可能 foobar2000 也就是取得的。
    我也是使用 winamp 2.80
    不過經常使用的還是 foobar2000 ,起碼有 foobar2000 SDK 可下載,可是是C...
      

  5.   

    好象 VBR 的文件頭有點怪,它可能是採用 ID3V2.4的格式寫MP3文件信息的,因為MP3的信息在文件的尾部。
    普通的Mp3個ID3V2.3是寫在文件頭部的。
      

  6.   

    to : CoolSlob(时不我待)  是没有文件头,只有帧头,先找帧头的同步信号$FFF,在帧头中会有边信息,边信息中有本帧开始的偏移量,这样就能一帧一帧的找,直到结尾。
      

  7.   

    這是一個老外的回答:mp3 uses frames with fixed sizes -> 1152 samplesso for 48 kHz the duration of one frame is 1152/48000 = 0.024 s
    for 44.1 kHz its 1152/441000 = 0.0261 sand so onsince in MP3 a frame can be considered an atom (you cant go shorter in length than that) the encoder probably pads the audio stream with silence to get a complete frameIOW - a MP3 file cant have any arbitrary length... only n*1152/sampling rate (n = 1, 2, 3 ...)I'm not sure if this whats going on because 0.06 seconds seems a bit much, but it could be an explanation
      

  8.   

    哪位大俠用過 XAudio.dll 嗎?XAudio.dll 可以取得播放的 MP3 的時間,但是可以取得毫秒嗎?
    我隻能取得到整秒。