X-Wing Alliance Add-Ons – Custom Audio Files

From Emperor's Hammer Encyclopaedia Imperia
Revision as of 20:09, 18 October 2023 by Jaggedfelliii (talk | contribs) (Created page with "==Introduction== X-Wing Alliance (XWA) allows the addition of both custom audio files and the reuse of the original game audio files by new Emperor’s Hammer (EH) custom XWA...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

X-Wing Alliance (XWA) allows the addition of both custom audio files and the reuse of the original game audio files by new Emperor’s Hammer (EH) custom XWA missions. You can add audio clips to play alongside the radio messages within the missions and to the briefings given at both the start and end of the missions. These custom audio files are not required for EH missions, but their addition is a very useful tool in storytelling and emersion in your missions.

Why to Include

The addition of audio allows the missions to have a more premium experience that feels closer to the original game and can aid in conveying the message of the story. Custom audio playing for the commander’s brief allows the player to listen to the briefing while looking at the Mission Craft list and the ship patch that launch at the start of the briefing, rather than having to navigate forward to the animated briefing and then back to the commander’s briefing text. This also has the benefit of allowing the player to look at the custom EH Patch that you may have chosen to include with your missions. Audio files playing with the radio messages allows you to be sure that the player receives the information you are trying to convey, even in the midst of a pitched dogfight where they might not take the time to read the radio message text popping up at the top of their screen.

How to Include

Audio Format

The base XWA game can support a narrow subsection of audio formats. The files must be mono audio and have a sample rate of either 11025Hz or 22050Hz. And be encoded as either 8-bit or 16-bit PCM .WAV file format. The lower the sample rate or encoding bit size the more compressed the audio file will be and the smaller the overall file size will be. However, there is a significant drop in audio quality the more compressed the file becomes. The original game manufacturers were able to get around this limitation by using professional audio mixing and mastering techniques which are beyond the scope of this guide. Needless to say, in general you are best served by going with a sample rate of 22050Hz and a 16-bit PCM encoding.

Custom Audio Source

The simplest source of custom audio would be for you, or someone you know, to record themselves speaking the lines or making the desired sound effects. This has the large advantage of the spoken audio not being as wooden as a Text-To-Speech software’s output.

However, as a mission creator you may not be comfortable with your ability to speak with all the different voices you envision for the custom battle. Or do not wish to complicate your work flow process by needing to get another person to voice the lines for the mission, especially if you think you might need to make changes to the audio later.

The tool the author uses is a Text-To-Speech software available through Amazon. Amazon Web Services, at the time of the writing of this guide, offers a 12-month free trial of many of their software packages normally meant for website backend services. One of the software packages is Amazon Polly which allows you to select different “Voices” to speak the audio. Please note that you can change the region that you are connecting to in the web address to change the options you have available to you for voices.

Under additional settings you will be able to select the output file Sample Rate and File format. While in theory you should be able to convert any file source to the format needed by XWA, this author has found that the game often won’t recognize files generated from certain sources. The results that have worked for the author has been to output from AWS in 22050Hz and OGG file format and then use an audio processing software package to covert to the 16-bit PCM .WAV format needed for the game.

Audio Post-Processing

There are many different audio editing software packages out there and some web-based services too, but the author of this guide found errors could be caused by many of the different web-based services. Audacity is a free open-source audio editing software package available for anyone to download.

Audacity is a powerful tool, allowing the creator to layer multiple sound tracks and sound effects together and covert them all into the file format needed by XWA. To simply covert the OGG file from Amazon Polly into the needed file format, you need to simply.

  1. Open the file in Audacity
  2. Verify that the file is Mono, 22050Hz
    1. If not go to Edit->Preferences and change the Project Sample Rate to 22050Hz
  3. Adjust the gain of the source file (see discussion later)
  4. Then covert to .WAV format by going to File->Export->Export as WAV
    1. Make sure the Save as type: is WAV (Microsoft)
    2. Make sure the Encoding is Signed 16-bit PCM
    3. Name your file (see below for file name requirements) and hit Save


You also can add different sound effects and alter the initial audio file, allowing you to increase the perceived number of voices available to you from the initial Text-To-Speech software.

Audacity also allows you to directly record audio using a microphone attached to your computer.

Adding Audio to Briefings

One thing to note first, you are only able to add custom audio to briefings in digital copies of XWA. This means the player will either need to be playing a version purchased from GoG or Steam. The CD version of the game is not able to see to the custom audio files during the briefings as the game is hard-coded to look at the CD (or .iso image) for all briefing audio. It is theoretically possible to modify the .iso image file of the CD, but that is beyond the expectations for anyone in EH to do to run a custom mission. In short, only digital versions will be able to hear the custom briefing audio files. Note: It is possible to make a CD version work with custom briefing audio via the X-Wing Alliance Upgrade project, but that platform is not supported by EH for any custom battles outside the TIE Fighter Total Conversion-Reimagined missions.

Second, while for radio messages (see below) there is no required file naming convention or file path (outside of needing to be within the Wave subdirectory within the XWA directory), briefing audio must comply with a strict naming format and file location. All briefing audio MUST be contained in a folder named B#M*. Where the # is the battle number, which is 8 for EH custom battles. And the * is the mission number (1, 2, 3, etc.). This folder MUST be placed within the WAVE/FRONTEND directory within the XWA main directory. The files within the folder MUST also follow a strict naming convention that will be detailed below.

Third, while YOGEME wave manager has tabs for the briefing audio, it is not how you add audio to briefings, you must just follow the instructions above for where to place the audio files and follow the instructions below on how to name the files. In fact, in the author’s experience, trying to add the briefing audio via YOGEME causes an error to occur in YOGEME and forces you to close the editor.

Commander’s Briefings

These are the briefings that play when the player first starts the mission from the Concourse, or selects the Commander’s Briefing at the bottom left of the screen during the animated briefing to be able to see the text of the briefing. The file name of the briefing audio MUST be as follows:

S0#$$**.wav

  • Where # is the battle number, again 8 for EH custom battles
  • Where $$ is the two digit mission number (ie. 01, 02, 03, etc.)
  • Where ** is the order of the files. This guide recommends making the whole briefing one file, so 01, as this will prevent the audio from being played out of order and make the creation of the audio file simpler.
  • Example – S080101.wav

It is best to have the audio match the words that are displayed on screen in the commander’s mission briefing.

Mission Successful Debriefing

These are the briefings that play when the player completes the mission successfully. The file name of the briefing audio MUST be as follows:

W0#$$**.wav

  • Where # is the battle number, again 8 for EH custom battles
  • Where $$ is the two digit mission number (ie. 01, 02, 03, etc.)
  • Where ** is the order of the files. This guide recommends making the whole briefing one file, so 01, as this will prevent the audio from being played out of order and make the creation of the audio file simpler.
  • Example – W080101.wav

It is best to have the audio match the words that are displayed on screen in the Mission Successful Debriefing.

Mission Failed Debriefing

These are the briefings that play when the player fails the mission. The file name of the briefing audio MUST be as follows:

L0#$$**.wav

  • Where # is the battle number, again 8 for EH custom battles
  • Where $$ is the two digit mission number (ie. 01, 02, 03, etc.)
  • Where ** is the order of the files. This guide recommends making the whole briefing one file, so 01, as this will prevent the audio from being played out of order and make the creation of the audio file simpler.
  • Example – L080101.wav

This audio file only plays while the player is looking at the mission statistics, not when they are looking at the mission hints. There is no native text being displayed so the debriefing can say anything you want, but it would be recommended to have it include the mission hints as some players don’t go to that screen.

Animated Briefing

These are the audio files that play when each Caption Text line is displayed in the animated briefing. The file names of the briefing audio MUST be as follows:

B0#$$**.wav

  • Where # is the battle number, again 8 for EH custom battles
  • Where $$ is the two digit mission number (ie. 01, 02, 03, etc.)
  • Where ** is the order of the files. Unlike the other briefings it IS NOT recommends to make the whole briefing one file as that prevents the player from hearing audio if they skip forward in the briefing. The order that the files are played is controlled by which Caption Text is being displayed in the briefing. The files will be associated with the Briefing Strings in the Tags and Strings tab of the briefing editor. When the Caption Text in the first slot is displayed on the screen, the file named 01 will be played. When the Caption Text in the second slot is displayed on the screen, the file named 02 will be played, and so on. So, while it is not required for the Briefing Strings to be used in order in the briefing, care must then be taken to order the file names of the audio files in the same manner. For this reason, it is HIGHLY recommended to order the Briefing Strings in the order they will be displayed during the briefing when adding custom briefing audio files.
  • Example – B080101.wav

Adding Audio to Radio Messages

One thing to note first, while the volume level of the audio outputted by Amazon Polly is at a comfortable level for the briefings, it is too quiet to be easily heard over the music and sound effects during the mission. Therefore, it is needed to increase the Gain of the audio file before converting it to the .WAV format to allow the player to hear the radio messages. This can be done by double-clicking the first slider under Effects on the left of the screen for each audio clip in Audacity. This causes a pop-up window to open where you can either type in the gain you wish or use the slider. The author has found that an 8.0db gain increase seems to make the radio messages loud enough to be heard without becoming painfully loud.

While the briefing files had to conform to a strict naming convention and file path, radio messages are less rigid. The only requirement is that the file be somewhere within the WAVE directory of the main XWA directory. A .LST file that MUST be written and placed in the WAVE/MISSIONVOICE folder tells the game where in the directory the needed audio file is and what its file name is. The LST file MUST be named to match your .TIE file for the mission (ie. 1b8m1Anti_R1.lst). The LST file also allows you to use pre-existing audio files from the base game to go with any of your radio messages.


While the audio files can be placed where ever within the WAVE directory, it is recommended to follow the original game’s convention of making a folder within the MissionVoice folder named for the mission (ie. B8m1) to house all the custom audio files for the mission.

You can either manually create the LST file, or YOGEME can create it for you using the Wave Manager tool in the editor. To find the Wave Manager in YOGEME look under the Tools drop down menu. In the manager you will see a list, in order, of the radio messages of the mission on the left. Select a radio message you want to add an audio file to and then select the … on the right to navigate to the audio file that you wish to associate with that radio message. You will be able to select the play button to preview the audio to ensure it is the file you want. Once you are done selecting the audio files you want for the radio messages you must select the Save button. This will cause YOGEME to write the LST file with the correct name and format to the WAVE/MISSIONVOICE folder.


Alternatively, you can write the LST file yourself using a text editor. The required format is each line of the LST corresponds to each radio message in the Messages Tab of the editor, in that order. If you want an audio file to play enter the file path and file name of the audio file at the correct line of the file. All file paths “start” at the WAVE directory and only subfolders from there need to be in the file path. If you don’t want an audio file to play during a radio message, then enter none.wav as the line in the LST file.

The reason that you might not want an audio file to play during a message is to the case that the full message required multiple radio lines due to length. It is best to make the audio file continuous and then not have anything play when the next line of the message is displayed. The game will continue to play the last audio file commanded until it is done, even if the radio messages on the screen have moved on.

You can use the radio messages to play any sound file you want, so this is also a way to get custom sound effects you want added to the mission into the game.

Final Thoughts

Adding custom audio files to you XWA mission is a great way to increase the perceived production value and quality of the mission and is a powerful tool in a mission creator’s arsenal to tell the story that they want to tell. Just remember, as with patches, some players will not want to go to the trouble to install the custom audio files when flying missions. Unlike with patches, this will not keep them from playing the missions, but your content may not be heard by all that play the levels.

Also, your readme file should give the player all the information they need on how to locate the WAV files in the directories and should remind them to delete at least the FRONTEND files, or the briefing audio of your mission will play anytime they play another EH custom battle.