Difference between revisions of "Soundtracks"

From xboxdevwiki
Jump to: navigation, search
(ST.DB: Corrected song storage in the song group struct and type of numSongGroups in the soundtrack struct.)
m (Folder Structure: soundtrack NNNN named subfolders are created in E:\TDATA\fffe0000\music\.)
 
(4 intermediate revisions by 3 users not shown)
Line 2: Line 2:
  
 
== Folder Structure ==
 
== Folder Structure ==
All soundtrack related data is stored in E:\TDATA\fffe0000. Songs are organized into groups of folders containing up to 6 WMA files. Zero-padded 4 decimal integers are used for the folder names, and zero-padded 8 decimal integers are used for the WMA file names. Metadata such as song title and which soundtrack a song belongs to is stored in the ST.DB file
+
All soundtrack related data is stored in E:\TDATA\fffe0000\. Songs are organized into groups of folders containing up to 6 WMA files. Zero-padded 4 decimal integers are used for the folder names stored in a subfolder named music, and zero-padded 8 decimal integers are used for the WMA file names. Metadata such as song title and which soundtrack a song belongs to is stored in the ST.DB file
  
 
== ST.DB ==
 
== ST.DB ==
The ST.DB file contains information about soundtracks loaded on the Xbox. Up to 100 soundtracks with 500 songs each can be used. Each header and struct described below is padded to 512 bytes.
+
The ST.DB file contains information about soundtracks loaded on the Xbox. Up to 100 soundtracks with 500 songs each can be used. Each header and struct described below is padded to 512 bytes, and all values are stored as little-endian.
  
File Layout:
+
'''File Layout:'''
  
 
<pre>(start of file)
 
<pre>(start of file)
Line 13: Line 13:
 
0200  Soundtrack Struct 1
 
0200  Soundtrack Struct 1
 
0400  [Soundtrack Struct 2]
 
0400  [Soundtrack Struct 2]
       ...
+
       ... (Zero-filled)
 
CA00  Song Group 1
 
CA00  Song Group 1
 
CC00  [Song Group 2]
 
CC00  [Song Group 2]
Line 27: Line 27:
 
| int32
 
| int32
 
| magic
 
| magic
| always 0x01 0x00 0x00 0x00
+
| always 0x00000001
 
|-
 
|-
 
| int32
 
| int32
Line 58: Line 58:
 
| int32
 
| int32
 
| magic
 
| magic
| always 0x71 0x13 0x02 0x00
+
| always 0x00021371
 
|-
 
|-
 
| int32
 
| int32
Line 65: Line 65:
 
|-
 
|-
 
| uint32
 
| uint32
| numSongGroups
+
| numSongs
 
|
 
|
 
|-
 
|-
 
| int32
 
| int32
| songGroupIds
+
| songGroupIds[84]
 
|
 
|
 
|-
 
|-
Line 78: Line 78:
 
| wchar
 
| wchar
 
| name[64]
 
| name[64]
| Unicode string
+
| Unicode{{FIXME|reason=Encoding? UCS-2?}} string
 
|-
 
|-
 
| char
 
| char
Line 93: Line 93:
 
| int32
 
| int32
 
| magic
 
| magic
| always 0x73 0x10 0x03 0x00
+
| always 0x00031073
 
|-
 
|-
 
| int32
 
| int32
Line 116: Line 116:
 
|-
 
|-
 
| wchar
 
| wchar
| songName[384]
+
| songName[192]
| 6 Unicode strings, each padded to 64 characters
+
| 6 Unicode{{FIXME|reason=Encoding? UCS-2?}} strings, each padded to 64 characters
 
|-
 
|-
 
| char
 
| char

Latest revision as of 03:08, 3 November 2021

The Xbox allows for soundstracks to be stored on the harddrive and played in-game. Music is copied from audio CDs using the dashboard and converted to WMA audio files. The notes gathered here are from decompiling StDB.dll from Xbox Soundtrack Manager.

Folder Structure

All soundtrack related data is stored in E:\TDATA\fffe0000\. Songs are organized into groups of folders containing up to 6 WMA files. Zero-padded 4 decimal integers are used for the folder names stored in a subfolder named music, and zero-padded 8 decimal integers are used for the WMA file names. Metadata such as song title and which soundtrack a song belongs to is stored in the ST.DB file

ST.DB

The ST.DB file contains information about soundtracks loaded on the Xbox. Up to 100 soundtracks with 500 songs each can be used. Each header and struct described below is padded to 512 bytes, and all values are stored as little-endian.

File Layout:

(start of file)
0000  Main Header
0200  Soundtrack Struct 1
0400  [Soundtrack Struct 2]
      ... (Zero-filled)
CA00  Song Group 1
CC00  [Song Group 2]
      ...
(end of file)

Main Header

Type Description Comment
int32 magic always 0x00000001
int32 numSoundtracks
int32 nextSoundtrackId
int32 soundtrackIds[100]
int32 nextSongId
char padding[96]

Soundtrack Struct

Type Description Comment
int32 magic always 0x00021371
int32 id
uint32 numSongs
int32 songGroupIds[84]
int32 totalTimeMilliseconds
wchar name[64] Unicode[FIXME] string
char padding[64]

Song Group Struct

Type Description Comment
int32 magic always 0x00031073
int32 soundtrackId
int32 id
int32 padding
int32 songId[6]
int32 songTimeMilliseconds[6]
wchar songName[192] 6 Unicode[FIXME] strings, each padded to 64 characters
char padding[64]

Default Encoding Settings

These are the encoding settings used by the dashboard when encoding WMA files:

Key Value
Format WMA Version 2
Codec Description Windows Media Audio V8
Encoding Tool Windows Media Encoding Utility 8.0.0.403
Bit Rate 128 kbps
Channels 2
Sampling Rate 44.1 kHz
Bit Depth 16 bit

The track number is added to the metadata.