ID3v2规格 [英] ID3v2 Specification

查看:113
本文介绍了ID3v2规格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基于 http://id3.org/id3v2.3.0 规范,框架标题为:

Based on http://id3.org/id3v2.3.0 specification, the layout of the frame header is:

Frame ID       $xx xx xx xx (four characters)
Size           $xx xx xx xx
Flags          $xx xx

但是同一页仅几行以下,表示允许使用不同类型的文本编码的帧在帧大小之后紧随其后的是一个文本编码描述字节.如果使用ISO-8859-1,则此字节应为$00;如果使用Unicode,则其字节应为$01.

But same page just couple of lines below that says that frames that allow different types of text encoding have a text encoding description byte directly after the frame size. If ISO-8859-1 is used this byte should be $00, if Unicode is used it should be $01.

这令人困惑,因为标志(2个字节)应该直接在帧大小信息之后,所以我希望编码字节在标志信息之后.

This is confusing, as the flags (2 bytes) should be directly after the frame size information, so I would expect the encoding byte to be after the flags information.

那么现在什么是正确的?

So now what is correct?

Frame ID       $xx xx xx xx (four characters)
Size           $xx xx xx xx
Flags          $xx xx
Encoding       $xx
Text

Frame ID       $xx xx xx xx (four characters)
Size           $xx xx xx xx
Encoding       $xx
Flags          $xx xx
Text

推荐答案

我认为这实际上可能是规范中措辞不佳的 mistake 案例.我在 ID3v2章节框架附录中找到了两个图表,其中显示了完整标题的示例.该文档描述了两种新引入的帧类型,这对于眼前的问题并不感兴趣.但幸运的是,它还包含嵌入的标题/歌曲名称/内容描述"框架(TIT2)和字幕/描述细化"框架(TIT3)的示例,它们都是文本框架*:

I think this might actually be a mistake case of bad wording in the spec. I found two diagrams in the ID3v2 Chapter Frame Addendum showing examples of complete headers. That document describes two newly introduced frame types, which are not interesting to the question at hand. But fortunately, it also contains examples of embedded 'Title/Songname/Content description'-frame (TIT2) and 'Subtitle/Description refinement'-frame (TIT3), which are both text frames*:

根据该图,标题框架(ID:TIT2)具有以下结构: 首先帧头:

According to the diagram, the Title frame (ID: TIT2) has the following structure: First the frame header:

Frame ID       $xx xx xx xx (four characters)
Size           $xx xx xx xx
Flags          $xx xx

,然后直接跟随与ID相关的字段:

Text encoding  $xx Information    
<text string according to encoding>

这种布局对我来说最有意义.如果您仍然对正确的布局仍有疑问,可以查看现有实现之一的来源.

This layout makes the most sense to me. If you still have doubts about the correct layout, you could check out the source of one of the existing implementations.

旁注:,它们在 ID3v2.4.0规范中进行了更改令人困惑的句子.

Sidenote: in the ID3v2.4.0 specification they changed the confusing sentence to.

允许不同类型的文本编码的框架包含一个文本 编码描述字节.

Frames that allow different types of text encoding contains a text encoding description byte.

* 只有允许不同类型的文本编码的框架具有文本编码描述字节.
不足为奇的是,其中大多数是文本框架

这篇关于ID3v2规格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆