Audio Commentary

From SDA Knowledge Base

Jump to: navigation, search

Introduction

SDA allows audio commentary in the form of a secondary audio track in an existing H.264/AAC audio/video stream. In other words, one video stream and two audio streams in one MP4 container. However, you must disable the secondary audio track so that QuickTime won't play it at the same time as the first (but still letting people switch to it if they want). This is easy to do and instructions are given later on this page. You don't actually even need QuickTime to do it.

Multiple audio tracks in the AVI container is still not allowed. Windows Media Player also happens to play all audio tracks at the same time.


Record yourself

First, get a microphone if you don't have one. You'll need a recording program; this guide will use Audacity, which is free. Before you record the actual commentary, you should play around with the program to figure out how loud to talk, where to put the microphone, etc. Make a test recording. If there is static in the recording, try using the Noise Removal tool. Highlight a sample of just noise, then go to Effects-->Noise Removal and select "Get Noise Profile". Now highlight the entire recording, go to Noise Removal again, and click "Remove Noise." If the slider was too far left, there will still be a lot of noise; if it was too far right, your voice will become distorted. Try adjusting the slider until you find a good balance. If you talk louder, you will probably have an easier time removing static. You can also try using Noise Removal multiple times. The best thing to do is to play around until you find what works. After you have gotten rid of noise, you may want to remove other sounds such as clicks that find their way into your recording. To do so, highlight the unwanted sound and click Generate-->Silence. If you just press delete, you'll remove a chunk of audio completely and everything after that will be too early. If there's something that's too quiet or too loud, you can highlight it and go to Effects-->Amplify. You can then move the slider to adjust the volume of that section. You may have to click "allow clipping".

When you actually record your commentary, you'll want to do everything the same as you did for your test recording. Open the run in your media player of choice and press pause. Open Audacity, press record, then go into the media player and hit play. Make sure the sound is off (it's best to set it to mute within the media player itself) or you may end up recording the game sound. The game sound and the commentary can still be mixed together later, but it's best to record just the commentary and then combine the two. If you do want to have the game sound mixed in, turn the sound on in the media player for a few seconds while you're recording the commentary, then turn it back off; this will record a few seconds' worth of game audio, enabling you to sync the voice track with the game audio later on. When you are done recording commentary, press stop. Perform noise removal, amplification, and so on as described in the paragraph above.

Check the sample rate of the commentary. You can find it in the box to the left of the waveform; it is in Hz. If the sample rate of the commentary is not the same as the sample rate of the game audio, you may run into pitch-related problems later when you have both in the same mp4 file. To check the sample rate of the game audio, import it into Audacity; if it doesn't import correctly, encode it as mp3 first with MeGUI. After checking the rate, you can press the X to the left of the waveform to remove the game audio (you can add it back later if you want to). If the rates match, you don't need to do anything extra. If they don't, you can change the sample rate of the commentary near the bottom left corner of the Audacity window next to the words "Project rate"; do not use the "Set Rate" feature, as this will create the same pitch problems you are trying to avoid. After changing the project rate, click File-->Export as WAV. Close and reopen Audacity, then import the wav you just created. The sample rate is now correct.

If you want to have your commentary track be just voice without the game sound, no further editing is required; click File-->Export as WAV to get the wav file you'll be compressing from (if you changed the sample rate above, you'll already have a wav file and can skip this step). If you want the game sound mixed in, go to Project-->Import Audio and select your game audio. As described above, it may not import correctly; if it doesn't, encode an mp3 version of the game audio with MeGUI and import that instead (if you did this above, you can use the same mp3 file). The audio tracks will not be in sync right away; this is where you can use the few seconds of game audio in the voice track that you (hopefully) recorded. Find the same few seconds of audio in the game audio track and put the cursor at a recognizable point of the waveform. Write down the time (found near the bottom of the window). Then put your cursor at the same point in the waveform in the voice track and write down the time. Calculate the difference between the two times. At this point, you will need to either add or subtract from the beginning of the voice track. To add an exact amount of silence, put your cursor near the beginning without highlighting anything, then click Generate-->Silence and type in the amount you calculated. To delete an exact amount, put your cursor near the beginning, hold Shift, and move the cursor right with the arrow keys; the size of your selection will be displayed near the bottom of the window. Press delete once you have selected the right amount. The two tracks are now in sync. Adjust the volume of each track using the sliders at the left that have minus and plus signs on either side. When you have found a balance between the tracks that allows your voice to be heard over the game audio, click File-->Export as WAV. It's a good idea to save the project file as well.


Compressing / Muxing the audio

Load your finished wav file in MeGUI for compression to AAC. DO NOT USE MP3! It is incompatible with QuickTime 7 and people will wonder why they can't open your run.

SDA is fairly strict about choosing the bitrate corresponding to whichever quality version you're encoding. However, with audio commentary it's quite lax; do whatever sounds good. Commentary with just the voice and no gameplay audio mixed in can go as low as 32 kbps and still sound good. If you're adding commentary to the LQ version, use mono 32 kbps.

Use MeGUI again to add the audio commentary. To add more streams, right click the "Audio 1" tab in the muxing window and select "add track". Don't get carried away, though; more audio tracks equals a bigger filesize. Consider lowering the bitrate of the commentary tracks if you have to. Make sure the game audio (without commentary) is the first audio track.


Tip: YAMB can also mux files for you and has other useful features.



Disabling the audio commentary for QuickTime 7

You absolutely must do this, even if it may be tedious to do so.

You have three options:


mp4nerf

This program will look for all audio/video tracks and disable any that it finds after the second. So make sure the gameplay audio/video are tracks one and two, audio commentary as track three or higher.

  • Download mp4nerf.
  • Run mp4nerf through the command line or use the batch file by dragging MP4 files on top of nerfit.bat.
  • The batch file will ask for confirmation, saying no will only display the matches that mp4nerf has found.
  • All done!


dumpster

Note that this method does not work if you are running an x64 edition of Windows.

  • First, you'll need to download and extract Dumpster (mirror).
  • Drag the MP4 file over dumpster.exe to load the program.
  • Double-click the line with 'moov'.
  • You'll see three 'trak' items. The first is probably the video track, the third is probably your second audio track. Double-click on that third 'trak' item.
  • Double-click 'tkhd'.
  • Select the line with 'flags'

DumpsterDisable.png

  • Change $000001 into $000000
  • Click Apply.
  • All done!


Warning: If you do any re-muxing of a file, it may reset the flag to $000001 and you'll have to start over.


mp4box

MP4Box is the command line program behind MeGUI and YAMB responsible for muxing streams into an MP4 container. You'll need to call it directly from the command line to disable the commentary track, since MeGUI and YAMB do not expose this functionality.

Put your video in the same directory as MP4Box.exe, open a command prompt in that folder and run the following command:

mp4box -new -add source_video.mp4:name=Video -add "source_audio.mp4:name=Game Sounds" -add commentary.mp4:name=Commentary:disable final_video.mp4

Or, if you already have your MP4 file with audio on it and just want to add your commentary track to it:

mp4box -new -add source_video.mp4#video:name=Video -add "source_video.mp4#audio:name=Game Sounds" -add commentary.mp4:name=Commentary:disable final_video.mp4

Return to the front page.

Personal tools