1

我拿了一个大小为 405.9 kB 的 mp3 文件并运行以下命令:

# Here fp points to the audio file
# find_header has been imported
def test(fp):
    start_pos = 0
    sync_pos, header, header_bytes = find_header(fp)
    i = 0
    while i < 30:
        start_pos += sync_pos
        sync_pos, header, header_bytes = find_header(fp, start_pos)
        print sync_pos
        i += 1


Output:
102
519
937
1773
3445
14312
21417
85365
127997
None

如果 mp3 文件具有没有任何标题的连续帧,我会感到困惑。这是否也意味着除了以下链接中描述的格式之外,还有其他帧头格式? http://www.mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm

4

0 回答 0