Adding Custom Audio
Game audio is in the WAV format. The has three primary types of sound: Music, Sound Effects, and Spoken Dialog.
All wav files should be in 16bit 44k to retain consistency in quality (32bit also works). Music is in stereo, while sound effects and spoken dialog are typically mono.
Editing Music
Adding customized music to the game can be done by placing the new .wav files in the Data\Audio\Music folder inside the mod folder you're working within and needs to be referenced in a new XML file. The primary XML file for editing music tracks is MusicEvents.XML. This file contains a list of all of the events or locations in the game that can trigger music. These are fairly self-explanatory, such as “Music_Main_Menu” or “Music_Skirmish_Multiplayer_Lobby_Theme”. As long as your music track is in the correct folder and you have it listed in one or more of the events in this XML, your music track should play correctly. Note that if there are multiple tracks listed in an event, the list is played in order each time the event triggers, unless you specifically set it to randomize (there is a tag for this in each event).
You can also set specifics on how the tracks are played including fade-in and fade-out times, play gaps, looping, etc. Again, most of the tags in this event block are pretty obvious as to what they do.
Editing Sound Effects (Non-Verbal)
New customized SFX should go into the Data\Audio\SFX\PC\2D and Data\Audio\SFX\PC\3D folders inside of your mod folder and referenced in the associated XML file. The 2D folders contain audio files typically used for UI sounds, notifications, and stereo ambience. The 3D folder contains audio files that are used for everything played back in 3D positions on maps such as engines, weapons, explosions, ambience, The primary XML file for editing sound effects events is SFXEventsNonLocalized.XML. This file contains a list of all of the sound effect events and "Presets" each event uses in the game that are triggered. Note that if there are multiple audio files listed in an event, the list is played in order each time the event triggers, unless it's set it to randomize. All parameters that each sound effect event uses is contained within the preset it uses. A specific parameter can be overridden if you put that parameter in the specified sound effect event with a different value, so that the preset itself is unaffected, but the new value you want is only reflected in the new sound event.
Editing Spoken Audio
Spoken audio works in a similar fashion to text tags, in that when assigning the audio to an object, the text tag is used vs. the audio wav file name. All spoken audio text is located in Audio_Text.CSV. It is important to note that each ACTOR has a specific three character code which is exclusive to all lines spoken by that actor. So even though the text of the line may be identical, the actor code determines which actual audio of that line will be used.
Example:
The following text tags are in the game for audio. Both of these speak the words “We have new orders!” when the unit is selected.
- TEXT_SFX_BRI_SELECT_1
- TEXT_SFX_FRI_SELECT_1
Note that both of these are identical except for the third section which contains the three character actor code. BRI is the code for the base British English soldier. FRI is code for the base French soldier. Even though the text of the line is identical, these two tags will speak those lines with different actors and different languages.
It is also important to note that units can have multiple sets of lines and will swap out that set each time you spawn a unit. For example, British Infantry contains actor sets for BRI (Base UK English), WEI (Welsh accented English), IRI (Irish accented English) and SCI (Scottish accented English). Even though the lines are identical in text, each unique set must have a unique actor code.
Adding Spoken Audio to Objects
Once you have your audio recorded and set up with text tags, you can add that audio to objects. You will need to determine where the audio links are located. For units that are in single-unit companies such as tanks, the audio hook will be on the unit object. For units that are in groups such as infantry, the audio hook will be on the company object.
In either case, open the file and look for the AudioComponent. This component lists all of the base commands (the Key) and the audio text tag associated with it (the Value). You cannot edit keys strictly through data, but you can add or remove existing keys to the audio list. Keys are commands or actions that trigger the audio event. For example, the key “Command_Select” triggers when the player selects the unit. Simply copy your new text tag into the value for your selected key, and your new voice audio will be heard when that action occurs.
You will notice that some infantry units have keys that are labeled with “tiers” such as “Command_Select_Tier_2”. This represents different voice sets. Each time a unit is placed onto the battlefield, it will randomly select one of the tier sets to use. You can use this feature to get different accents and speech patterns for a single unit type if desired.