admin 管理员组文章数量: 1184232
cda music tracks file format
by wojtek kaniewski 1997
note: everything in this file is based on my own investigations.
all information that you'll find in this text file do not
come from microsoft corp.
cda files are generally riff resources. the riff id of .cda file is
"cdda" (43h, 44h, 44h, 41h). they contain only one data block
called "fmt " (66h, 6dh, 74h, 20h). in current version of .cda file,
this block is 24 bytes long. here's structure of it:
offset length description
00h 02h cda file version. currently equals 1. if it has other value, following data may be out of date.
02h 02h number of track.
04h 04h cd disc serial number (the one stored in cdplayer.ini)
08h 04h beginning of the track in hsg format.
0ch 04h length of the track in hsg format.
10h 04h beginning of the track in red-book format.
14h 04h length of the track in red-book format.
as you see, time is represented in two formats: hsg and red-book.
hsg can be calculated as following:
time = minute * 4500 + second * 75 + frame
red-book is much easier to use, because it contains minutes,
seconds and frames in unmodified form, byte-packed:
offset length description
00h 01h frame
01h 01h second
02h 01h minute
03h 01h not used
now, i'll show you an example file. first part is a hex dump
of the file, the second is the explanation of the fields.
52 49 46 46 24 00 00 00 43 44 44 41 66 6d 74 20 riff$...cddafmt
18 00 00 00 01 00 04 00 b8 24 f6 00 f7 11 01 00 .........$......
b4 5c 00 00 0a 25 0f 00 20 10 05 00 ./...%.. ...
01 00 - first version of cda file :)
04 00 - fourth track
b8 24 f6 00 - serial number of cd in cdplayer.ini is [f623b8]
f7 11 01 00 - begining of track in hsg format
b4 5c 00 00 - length of track in hsg format
0a 25 0f 00 - begining of track in red-book format (15:37)
20 10 05 00 - length of track in red-book format (05:16)
that's all. it should be enough to write cda viewer :) if you need more
info or something isn't clear, feel free to write.
版权声明:本文标题:CDA音乐的秘密武器:探索与Adobe Flash Player的不解之缘 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1773713340a3564875.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论