Difference between revisions of "AGSC (File Format)"

From Retro Modding Wiki
Jump to: navigation, search
(AGSC (Metroid Prime 1))
Line 1: Line 1:
'''AGSC''' is the sound format for Metroid Prime and Metroid Prime 2: Echoes. According to the debug maps in Metroid Prime, there are references to various "classes", with one of them controlling audio in the map, known as AudioGroupSet.  So presumably, AGSC is an abbreviation for '''Audio Group Set Class'''.   
+
'''AGSC''' is the sound effect format for Metroid Prime and Metroid Prime 2: Echoes. Each AGSC file contains a group of sound effects. According to the debug maps in Metroid Prime, there are references to various "classes", with one of them controlling audio in the map, known as AudioGroupSet.  So presumably, AGSC is an abbreviation for '''Audio Group Set Class'''.   
  
The audio codec used for AGSC is the standard Gamecube DSP ADPCM codec, as described in the Gamecube SDK.   
+
The audio codec used im AGSC is the standard GameCube DSP ADPCM codec, as described in the GameCube SDK.   
  
 
__TOC__
 
__TOC__
Line 7: Line 7:
 
== Format ==
 
== Format ==
  
There are two types of AGSC files: those found in Metroid Prime, and a slightly different version in Metroid Prime 2.
+
The AGSC format is split up into four distinct data chunks; two unknown chunks, one for sound metadata, and one for actual sound data. The format is very similar between Metroid Prime 1 and 2; the main difference is the header, and some slight changes in the way the four chunks are organized. In Metroid Prime, each chunk begins with its own size value; in Metroid Prime 2, every chunk instead has its size listed at the beginning of the file, at the end of the header. In addition, in Metroid Prime, the third chunk is sound data, and the fourth is sound metadata; in Metroid Prime 2, it's the other way around.
  
=== AGSC (Metroid Prime 1) ===
+
=== Header ===
  
==== Header ====
+
==== Metroid Prime ====
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 19: Line 19:
 
|-
 
|-
 
| 0x0
 
| 0x0
| 7
+
| '''D'''
| '''Audio Directory'''. Always 'Audio/.' (0x417564696F2F00)
+
| '''Audio Directory'''. Always "Audio/." Zero-terminated.
 
|-
 
|-
| 0x7
+
| 0x0 + D
| Varies
+
| '''N'''
| '''Audio Subdirectory''' This tells us what sounds are in the file (for example, "metroid" or "weapons"). After the subdirectory name, there is also a 0x00 byte that follows for padding.
+
| '''Audio Group Name'''. Zero-terminated.
 
|-
 
|-
|colspan=3 | '''Start of offset chunks table'''  Each chunk is in order, each one starting with its size value, 32 bytes.
+
| 0x0 + D + N
|-
+
|colspan=2 | End of header
|colspan=3 | '''End of header''' After all the chunk offsets are listed, the header chunk terminates with 0xFFFFFFFF.
+
 
|}
 
|}
  
=== AGSC (Metroid Prime 2) ===
+
==== Metroid Prime 2 ====
 +
 
 +
{|class="wikitable"
 +
! Offset
 +
! Size
 +
! Description
 +
|-
 +
| 0x0
 +
| 4
 +
| Unknown; always 1.
 +
|-
 +
| 0x4
 +
| D
 +
| '''Audio Group Name'''. This typically describes what sounds are in the file (for example, "Metroid" or "Weapons"). Zero-terminated.
 +
|-
 +
| 0x4 + D
 +
| 4
 +
| '''Chunk 1 size'''.
 +
|-
 +
| 0x8 + D
 +
| 4
 +
| '''Chunk 2 size'''.
 +
|-
 +
| 0xC + D
 +
| 4
 +
| '''Sound metadata chunk size'''.
 +
|-
 +
| 0x10 + D
 +
| 4
 +
| '''Sound data chunk size'''.
 +
|}
  
 
==== Header ====
 
==== Header ====

Revision as of 06:30, 23 January 2015

AGSC is the sound effect format for Metroid Prime and Metroid Prime 2: Echoes. Each AGSC file contains a group of sound effects. According to the debug maps in Metroid Prime, there are references to various "classes", with one of them controlling audio in the map, known as AudioGroupSet. So presumably, AGSC is an abbreviation for Audio Group Set Class.

The audio codec used im AGSC is the standard GameCube DSP ADPCM codec, as described in the GameCube SDK.

Format

The AGSC format is split up into four distinct data chunks; two unknown chunks, one for sound metadata, and one for actual sound data. The format is very similar between Metroid Prime 1 and 2; the main difference is the header, and some slight changes in the way the four chunks are organized. In Metroid Prime, each chunk begins with its own size value; in Metroid Prime 2, every chunk instead has its size listed at the beginning of the file, at the end of the header. In addition, in Metroid Prime, the third chunk is sound data, and the fourth is sound metadata; in Metroid Prime 2, it's the other way around.

Header

Metroid Prime

Offset Size Description
0x0 D Audio Directory. Always "Audio/." Zero-terminated.
0x0 + D N Audio Group Name. Zero-terminated.
0x0 + D + N End of header

Metroid Prime 2

Offset Size Description
0x0 4 Unknown; always 1.
0x4 D Audio Group Name. This typically describes what sounds are in the file (for example, "Metroid" or "Weapons"). Zero-terminated.
0x4 + D 4 Chunk 1 size.
0x8 + D 4 Chunk 2 size.
0xC + D 4 Sound metadata chunk size.
0x10 + D 4 Sound data chunk size.

Header