SPCH

**SPCH**, or Speech Data, is a format used in Metal Gear Solid V: The Phantom Pain to make in-game characters speak specified voice clips, either in enemy soldier conversations, prisoner carrying monologues or unique story characters' monologues. It functions when called by commands CallVoice, CallMonologue, CallRadio, CallConversation or other with a label, making the specified in-game character play a voice clip, with an option for the character to play unique animations while doing so. The format is Little-Endian, meaning bytes are written in reverse order of significance.

These files can be decompiled and compiled with SpchTool into XML files.

## Header

```
0x00-0x03 - "spch"
0x04-0x05 - Padding
0x06-0x07 - (uint16) Amount of labels in the file
0x08-0x0F - Padding - 0x07 bytes of padding per label.

```

## Label entry definition

```
0x00-0x03 - (uint32) StrCode32 hash of the label's name
0x04-0x07 - (uint32) FNV132 hash of the Voice Event name from the soundbanks
0x08 - (uint8) Number of voice clip entries in this label
0x09 - 0x0B - Padding

```

The Voice Event name hashes can be found inside the HIRC sections of .sbp soundbank files, separated into HIRC.dat if extracted by SecaProject's SBP\_Tool. The Voice Event is always followed up by 0x6402, and the Voice Ids used in the label are usually from the same list specified here. Sometimes, the Voice Event in the label entry definition is null, specifically in CpRadioSeqCommon.spch.

### Voice clip entry

```
0x00-0x03 - (uint32) StrCode32 of the speaker's voice type
0x04-0x07 - (uint32) FNV132 hash of the Voice Id from the .sbp soundbanks
0x08-0x0B - (uint32) StrCode32 hash of animation act
0x0C-0x0F - Padding?
0x10-0x13 - (float) Pause before the next voice clip is played, in seconds

```

As previously mentioned, the Voice Id can be found in a list in the HIRC sections of .sbp soundbank files, after the label entry definition's Voice Event. The entries in the list are separated with 0x32006400. The first four bytes of the entry are the Voice Id, and the other is HIRC object name to another much earlier object where .wem sound file names (as extracted by SecaProject's SBP\_Tool) are usually listed twice in a row, of course, in Little-Endian, twelve bytes after the link mentioned in the Voice Ids, however this manual method of locating sound files' Voice Ids doesn't always apply.

Animation act ids for each entity are listed in Metal Gear Solid V's .exe, as Little-Endian StrCode32 hashes.

## SpchTool Usage

With SpchTool, it's possible to edit .spch files by decompiling them into simpler XML documents and compiling them back. However, values from .sbp soundbanks still have to be acquired manually.

Decompiled label entries are represented like this:

```
 <label labelName="CT10041\_03c" sbpListId="3445964925">
 <voiceClip voiceType="ene\_a" sbpVoiceClipId="585221331" animationAct="0" beforePause="0" afterPause="0" />
 <voiceClip voiceType="ene\_a" sbpVoiceClipId="585221330" animationAct="0" beforePause="0" afterPause="0" />
 <voiceClip voiceType="ene\_c" sbpVoiceClipId="585221341" animationAct="0" beforePause="0" afterPause="0" />
 <voiceClip voiceType="ene\_a" sbpVoiceClipId="585221340" animationAct="0" beforePause="0" afterPause="0" />
 <voiceClip voiceType="ene\_a" sbpVoiceClipId="568443746" animationAct="0" beforePause="0" afterPause="0" />
 </label>

```
The labelName are be used by Lua Commands `RequestRadio`, `CallRadio`, `CallMonologue` and `CallConversation`, and with some cases like CP radio conversations, by the .exe. Sometimes they're hashed in StrCode32. The sbpListId FNV132 hash can be found in .sbp files' HIRC section. You can divide .sbp into .wem files and data sections with SecaProject's SBP\_Tool. From there, you'll need to find the hash in hexadecimal Little-Endian format on top of arrays at the bottom of the HIRC section, and they're usually followed up by the bytes `64 02`. In CpRadioSeqCommon.spch, this is not specified, as the voiceType is not specified either.

The voiceClip entries will all be played in order, and the soldier first listed will begin the conversation, the second one will be the "friend" specified by CallConversation, and any more will be the third parties in given order. The voiceType will specify which voice the soldier should use, however CpRadioSeqCommon.spch only specifies soldiers as `enemy` to make it open to what voiceType should be used based on what the soldier's voiceType already is. The sbpVoiceClipId FNV132 hash can be found in the .sbp files' HIRC section, in the arrays at the end, which area headed by the sbpListId used in the label, and there they are paired with values that can also be found in a much earlier section in the HIRC section with eight bytes after them, names of the .wem sound files written twice in a row. However, this doesn't always apply. The animationAct is the name or hash of the animation the speaker will play - there's descriptions and names of them later down this page. The afterPause is a float value representing how many seconds long the pause between the end of the current voiceClip and the start of the next one will be. The beforePause value is never used in-game, and it might possibly not be the inverse of afterPause.

## Voice type dictionary

This is a list of some voice types that can be used by SPCH files.

## Animation act dictionary

This is a list of some animation act ids that can be used by SPCH files.