Tips & Tricks

This section presents a collection of tips & tricks to help get the most out of HLDJ.

Tips & Tricks covers the following topics:
Creating & editing audio files in HL audio format
Queueing-up audio files
Creating shortcuts, scripts & binds
Finding the game directory
List of common game directories
Finding the game audio directory
List of common game audio directories

Creating & editing audio files in HL audio format

Having the right audio files in the HL audio format is perhaps one of the most important things to using HLDJ properly. The first thing you need in order to create and edit any audio file is an audio editor. These come in a variety of flavors (i.e. Windows Sound Recorder, Sony SoundForge, etc.) but for simplicity and availability you can use one of the freeware audio editors/converters in the list of free audio editors. This particular example uses Audacity. Once you have your audio editing software of choice, open the desired audio file with it. Next convert it to the HL audio format. Using Audacity, look for the label "Project rate:" near the bottom of the editor and click on the button next to it; select 8000 if it is for use with a HL1 game or 11025 for a HL2 (Source) game in the list that appears. Go back up to the section that that displays the track information (the small window attached to the left of the track waveform spectrogram). Click on the drop down arrow next to the track title and select "Mono". If this item is grayed, first select "Split Stereo Track" then try the previous step again on either of the two tracks that are created afterwards. Delete the track that you do not use (hit the "x" button in the corner of its window). Click on the arrow again and highlight "Set Sample Format"; select "16-bit" from the list that appears. Now open the "File" menu and select "Export As Wav". Name and save the wav file into your HLDJ audio directory; now it is ready for use in-game! Repeat these steps for all audio files you wish to use with HLDJ.
Click on the picture below for a visual demo of the above steps:

Audio editors can also be used to edit and modify audio files. You can perform an almost endless array of tweaks and modifications to your audio file depending on which audio editing software you use. Explore your audio editor and expirement with its functions. Some of the most useful functions are using equalizers and filters to adjust the treble and bass of the audio file (too much treble and especially too much bass in an audio file can distort the sound quality).

Queueing-up audio files

While one audio file is already playing, you can queue up another one by selecting it. Simply select it as you normally would (i.e. by number, by hldjn/hldjp, by search, etc.) and it will be ready to play as soon as you stop the current one.
Example: load song #23, then while its playing, use hldjn to queue the next song, now when you are ready to switch to the new song, just double-tap your Play Audio Key (once to stop the current song, again to start the queued one) and it will smoothly switch to the new song.
You can use this technique to create the ultimate seamless transition between switching songs.

Creating shortcuts, scripts & binds

Using HLDJ commands and selecting audio files can be customized into something as simple as a push of a button with the use of shortcut aliases, scripts and binds. HLDJ original command names tend to be prefixed with "hldj", this is necessary so that HLDJ can remain compatible with other commands in the game. However, you can change HLDJ command names to whatever you'd like using the alias command:
alias name command
Where "name" is the shortcut name for the command "command". Using this, you can create short names for commonly used commands such as the next/previous commands ("hldjn"/"hldjp"). For example, you could shorten the next command ("hldjn") to simply "nxt" by typing the following in console:
alias nxt hldjn
This would allow you to only have to type "nxt" into the console instead of "hldjn" to load the next audio file. However, if binds are used, you can eliminate even having to type in the console at all.
bind key command
Where key is the keyboard key you wish to issue the command "command" when pressed. Using this you can bind keys to your commonly-used HLDJ commands. For example, you could bind the next command to the "n" key as follows:
bind n hldjn

Since audio selection in HLDJ is done through commands, you can also use the alias and bind commands to let you select an audio file at the push of a button. As described in the In-Game section, there are a number of ways to select an audio file: by number, by relative name, and by absolute name. All three methods and how to create binds for them is described below:

Binding a key to the number of an audio file or folder is the easiest way to select it by key. For example, you could bind audio file number 5 in the audio list to keypad 5 as follows:
bind KP_5 5
This is easy enough to do, however it is important to note that audio file numbers may change as files are added to and deleted from your audio folder, so this bind will work only until you change the contents of your audio folder. A more consistent bind can be created using the name methods.

Binding an audio file by name rather than number can lead to more consistent results even after the audio folder has been changed. For example, if audio file number 5 is called "myaudio.wav", you could bind it to a key (such as keypad 5) as follows:
bind KP_5 "bind:myaud;hldjsf"
This binds keypad 5 to select the audio file by name instead of number (if you are confused about the syntax used above, please refer to the In-Game section). The advantage of this is that even if the number assigned to "myaudio.wav" changes, your bind will still load the same audio file (as long as the name stays the same). However, it is again important to note that this bind will only work in a certain audio directory, if you load a different directory that does not contain this file name then the bind will not work as you expected. This is where the absolute name method is best used (as desribed below).

To ensure that your audio file will consistently be loaded, no matter what directory you are currently in, you can create a bind using the absolute name method. For the same example as previously used, you could now bind keypad 5 as such:
bind KP_5 "bind:$\myaud;hldjsf"
This gives HLDJ information about what directory to look in when loading "myaudio.wav" (in this example, the home audio directory). This, although not the easiest method, is the best way to ensure that your favorite audio files and folders are loaded at the push of a button!

Since aliases created in console are deleted after the game is closed, saving them will require that you place your custom aliases in a configuration file (also known as a script). This is a convenient place to keep all of your custom HLDJ aliases and binds together. There are many scripting tutorials on-line, but basically a script is a text file with the extension ".cfg" that contains commands.

Finding the game directory

Finding the game directory for a game is as easy as performing a search in Windows. There are three methods of doing this (ranging in accuracy and ease) that all use the Windows Search function. To help Windows Search out, you should start the search from you Steam directory (open your Steam directory and hit ctrl+F or F3). For the first method, type and enter the names of any of the relevant game files into the search field (i.e. "config.cfg" if it is a HL game, or "GameInfo.txt" or the "cfg" folder if it is a Source game). Depending on how many Steam games you have, Windows Search may find many of these files in different folders. Just browse down the "In Folder" column and look for the folder that matches the game you are trying to find (usually the folder will contain the game's name somewhere in its path). You can open up the folder (right click, select "Open containing folder") and check its contents just to be sure it is the right one.

Another method of finding the game directory is by using the "gamedir" command. However, this command only exists in Half-Life games (does not work in Source games). Open up the HL game whose directory you wish to find and pull down the console. Type and enter "gamedir". The game will then display the name of the game directory in console. Now you can use this name to perform an even more accurate Windows Search (same steps as above, except use the directory name as the search term) to find the game's directory.

The best and most accurate method of finding the game directory is by creating a target file. To create this file, open up the game whose directory you wish to find and pull down the console. If it is an HL game, type "writecfg" followed by a unique name; if it is a Source game, type "host_writeconfig" followed by a unique name. The unique name should be any name that will be easy to find later on using Windows Search.
Here is an example:
HL game: writecfg find_my_game_dir
Source game: host_writeconfig find_my_game_dir

After the game informs you that the file has been created succesfully, close the game and open Windows Search from your Steam directory (same procedure as before). Now perform a search for this file name and take note of the "In Folder" column. If the file was created by an HL game, the game directory is the same directory that contains the file, if it was created by a Source game, it is one level up from this directory. After finding the game directory, you can safely delete this file if you no longer need it (don't worry, it is only a copy of your "config.cfg" file).
If you are still stuck, or just need a quick reference you can also see the List of common game directories.

List of common game directories

Listed are some common games and their corresponding game directories (relative to the Steam directory; in alphabetical order).
Game Name: Game Directory:
Action Half-Life ...\SteamApps\username\?
Adrenaline Gamer ...\SteamApps\username\?
The Battle Grounds ...\SteamApps\username\?
Battle Grounds 2 ...\SteamApps\username\?
BrainBread ...\SteamApps\username\half-life\brainbread
Counter-Strike ...\SteamApps\username\counter-strike\cstrike
Counter-Strike: Condition Zero ...\SteamApps\username\condition zero\czero
Counter-Strike: Source ...\SteamApps\username\counter-strike source\cstrike
Day of Defeat ...\SteamApps\username\day of defeat\dod
Day of Defeat: Source ...\SteamApps\username\day of defeat source\dod
Dark Messiah of Might & Magic ...\SteamApps\username\?
Deathmatch Classic ...\SteamApps\username\deathmatch classic\dmc
Digital Paintball ...\SteamApps\username\?
Dystopia ...\SteamApps\username\?
Earth's Special Forces ...\SteamApps\username\?
Empires ...\SourceMods\Empires
esf_openbeta ...\SteamApps\username\?
exite ...\SteamApps\username\?
Firearms ...\SteamApps\username\?
Garry's Mod ...\SourceMods\username\gmod
gesource ...\SteamApps\username\?
Half-Life ...\SteamApps\username\half-life\valve
Half-Life 2 ...\SteamApps\username\half-life 2\hl2
Half-Life 2 Captures The Flag ...\SteamApps\username\?
Half-Life 2 Deathmatch Pro ...\SteamApps\username\?
Half-Life 2: Deathmatch ...\SteamApps\username\half-life 2 deathmatch\hl2mp
Hidden: Source ...\SteamApps\username\?
hl2coop ...\SteamApps\username\?
Hostile Intent ...\SteamApps\username\half-life\hostileintent
Natural Selection ...\SteamApps\username\half-life\ns
Opposing Force ...\SteamApps\username\opposing force\gearbox
Ricochet ...\SteamApps\username\ricochet\ricochet
Team Fortress Classic ...\SteamApps\username\team fortress classic\tfc

If you know the correct path of any game directory marked with a "?" (or feel a game is missing), please suggest it on the forums.

Finding the game audio directory

Normally, for most games, it is not necessary for you to find the Game Audio Directory (not to be confused with the Game Directory or Audio Directory!), as HLDJ will do this for you; however, there is a special exception for third-party Source mods (those contained in the "SourceMods" directory). These games will require that you fill out the "Use alternate Game Audio Directory" field in Setup. To find the Game Audio Directory for your game, perform the following steps:
1) Launch the game whose game audio directory you wish to find.
2) Set the variable "voice_recordtofile" to "1" (type and enter "voice_recordtofile 1") into the console.
3) Join a server (you can just create your own local server).
4) Once you are in the game, activate your microphone for a couple seconds (or you can enter "+voicerecord; wait; wait ;wait; -voicerecord" into console). The game will record the microphone input to the files "voice_decompressed.wav" and "voice_micdata.wav".
5) Set "voice_recordtofile" back to "0" (type and enter "voice_recordtofile 0") and then close the game.
6) Open up your Steam directory and search it for either of the above mentioned files (use Windows search as described in Finding the game directory).
7) When you find the file, its containing folder will be the Game Audio Directory (the folder that is listed under the "In Folder" column of the search window). You can now delete the created files if you no longer need them.
As described in the glossary definition, the Game Audio Directory of a 3rd-party Source mod will usually be the parent folder of the Source game that the mod has based its content off of. Listed below are the Game Audio Directories of some common third-party Source mods.

List of common game audio directories

Listed are some common 3rd-party Source mods and their corresponding game audio directories (relative to the Steam directory; in alphabetical order).
Game Name: Game Audio Directory:
Empires ...\SteamApps\username\half-life 2
Eternal Silence ...\SteamApps\username\half-life 2
Garry's Mod (<9) ...\SteamApps\username\half-life 2
Zombie Master ...\SteamApps\username\source sdk base

If you know the correct path of any game audio directory marked with a "?" (or feel a game is missing), please suggest it on the forums.