RIFF CD-DA file sample dump

Within Windows 95/98, a pseudo file is assigned to each audio track. These files are named Track01.cda, Track02.cda and so forth. You can access them with commands like dir and copy. Please note that this only works on audio cds. Mixed mode cds (with data and audio portions) only show the data portions.
Within your self-written programm you can "open" and read the file. This is a sample dump of Track01.cda:
000000: 52 49 46 46 24 00 00 00  43 44 44 41 66 6D 74 20 RIFF$...CDDAfmt
        !         ! !         !  !         ! !         !
        !         ! !         !  !         ! +---------+- start of format chunk
        !         ! !         !  +---------+------------- chunk identifier
        !         ! +---------+-------------------------- length of next chunk
        +---------+-------------------------------------- RIFF file identifier
000010: 18 00 00 00 01 00 01 00  FA EB 37 01 21 00 00 00 ..........7.!...
        !         ! !   ! !   !  !         ! !         !
        !         ! !   ! !   !  !         ! +---------+- track start in frames
        !         ! !   ! !   !  +---------+------------- ID
        !         ! !   ! +---+-------------------------- track number
        !         ! +---+-------------------------------- cda file version
        +---------+-------------------------------------- length of chunk
000020: 3A 4F 00 00 21 02 00 00  20 1E 04 00             :O..!... ...
        !         ! !! !! !!     !! !! !!
        !         ! !! !! !!     !! !! ++---------------- track length minutes
        !         ! !! !! !!     !! ++------------------- track length seconds
        !         ! !! !! !!     ++---------------------- track length frames
        !         ! !! !! ++----------------------------- track start minutes
        !         ! !! ++-------------------------------- track start seconds
        !         ! ++----------------------------------- track start frames
        +---------+-------------------------------------- track size in frames
At byte offset 18h (counting from zero) you find the same bytes as in cdplayer.ini - in reverse order:
[137EBFA]
EntryType=1
artist=Jackson, Joe
title=Blaze Of Glory
numtracks=12
... and so forth.
Note that the leading zero is stripped off.

Visual Basic sample code:

Thanks to Andrew O. Dennison, USA
Option Explicit
Function cd_alias(ByVal Drive As String) As String
    On Error GoTo Errorhandler
    Dim lRec As Long
    Dim fn As Integer

    fn = FreeFile
    Open Left(Drive, 1) & ":\track01.cda" For Random As #fn Len = Len(lRec)
    Get #fn, 7, lRec
    cd_alias = Hex$(lRec)
    Close fn
    Exit Function

Errorhandler:
    ' return blank string
End Function

back to Q&A