Sound/Music Tutorial
Sounds, Music and Speech are some of the most interesting aspects of mission-making in OFP. The inclusion of any/all of them can take a mission to a new level of fun. For example, the mission "Air Cavalry" by Kyllikki includes a Jimi Hendrix song during a chopper ride. I made special note of this during the review, as it was enjoyed by all the players at the time.

Let's face it, long chopper/boat/truck rides can be really boring with nothing to listen to or do :). Until the use of voice comms becomes prevalent, most players ( in my experience ) only use text-chat to communicate. A little extraneous noise goes a long way.

how hard is it ?
It's relatively time consuming, but not technically difficult. You need to be comfortable with the description.ext file, and have a basic understanding of csv files. Thankfully, you can pretty much all the work in notepad :)

What do i need ?
A decent audio editor, such as : Wavelab, SoundForge etc
A converter from wav to ogg format :

Use this little gem here

To make your own voices, a microphone and a decent soundcard are vital

For automated voices try these sites.
Rhetorical Voice
AT&T Labs
Bell Labs
A bit of inguenity and flair comes in handy too :)

One thing i've found absolutely VITAL, is friends. Espicially friends who can do accents. Nothing starts a good conversation over icq like me sending out messages to everybody "Anyone do a decent accent ??? " :)
Anyway, how you acquire your audio files is really personal preference. Personally, i use friends voices for the basic speech, and grab music from whatever i like.

Onto formats... this stuff will make or break you. OFP can be very twitchy when it comes to the settings of the audio files.
What works is this 16 bit, 44100 kilohertz, 64 kps bit rate
The funky it is in the stereo / mono aspect. Music is fine in Stereo or Mono, but Speech and Radio MUST be in Mono.

Once you've got your wav files, start up the Egg Drop, the converter listed up above. It's a simple case of drag-n-drop. Drag the file onto the cute little window of Egg Converter, and converts the wav to ogg format. One thing to note about Egg Drop is the default bit-rate is 80kps. You have to change this every time you start the program.

Ok, so now you've got the ogg files you want. You need to add a couple folders to your mission folder. Like this :



As you can see, the two "new" folders are "sound" and "music"

Music = any music files you want to include
Sound = everything else. Speech and Radio

That's the hardest bits done. The rest is pretty much cut-n-paste.
Moving onto the Description.ext file. You need to declare all the audio files you will be using, in their respective classes, Music, Sound ( speech ) , and Radio.

Lets start with the Music class first....

class CfgMusic // Overall class name
{
tracks[]={musicfilename};
// declaring the music file's name
class musicfilename
// the actual declaration
{
name = "";
sound[] = {musicmusicfilename.ogg, db+30, 1.0};
// declares which ogg file to use
};
};


Now, the first thing you're probably saying is "What the f*ck ?? " Relax, it's pretty straight-forward.
Important things to note.
* like all classes, you must start with " { " and end with " }; "
* Syntax is vital, so make sure you don't have any spelling errors.
* "sound[] = {musicmusicfilename.ogg, db+30, 1.0}; is the vital line. You're telling OFP the name/location of the file to use
* db+30 is the volume the file is to be played at
* 1.0 is the relative pitch of the file. If you want it to sound exactly as it did when you created it, leave this at 1.0

There's no real biggies here. The example file has this code, minus the comments.

Onto the next class, Radio,

class CfgRadio
{
sounds[] = {radiofilename};
class radiofilename
{
name = "";
sound[] = {"radiofilename.ogg", db+0, 1.0};
title = $STRM_radiofilename;
};
};


As you can see, it's pretty much indentical to the Music class.

* title = $STRM_radiofilename; tells OFP which text string to display. this ties in with the Stringtable.csv file

And now for Sounds

class CfgSounds
{
sounds[] = {soundfilename};
class soundfilename
{
name = "";
sound[] = {" soundfilename ", db-40, 1.0};
titles[] =
{
0, $STRM_ soundfilename
};
};


It's is damn-near identical to the Radio class, with minor differences.

OK, moving on to the Stringtable.csv file. This is straightforward.

LANGUAGE,English,Comment
STRM_musicfilename,
STRM_radiofilename, **text** .,
STRM_soundfilename, **text** .,


This is obviously only the english side. Seeing as i don't speak French or Italian or Spanish or German i leave out the translations :)

The Stringtable.csv is where title = $STRM_radiofilename; is referred to. Notice that the " $ " has been dropped however. It is vital that both strings are indentical, except for the " $ ". Otherwise, you won't hear diddly-shit in-game.

The " **text** " is whatever you want for the Sounds/Radio. You can happily leave it out, but make sure the punctuation remains. The example file is a good place to look about now :)

That's pretty much it for stuff outside the editor. Time to start up OFP...

There's about a dozen or so commands you can use to implement the audio files you've slaved over.....

Radio
Enable Radio = Set to False for no radio messages, True to receive radio messages
Syntax EnableRadio TRUE/FALSE
GroupRadio = members of your group receive what you transmit
Syntax unitname GroupRadio "radiofilename"
VehicleRadio = all units in your current vehicle receive what you transmit
Syntax unitname VehicleRadio "radiofilename"
SideRadio = all units on your side receive what you transmit
Syntax unitname SideRadio "radiofilename"
GlobalRadio = all units in the game receive what you transmit
Syntax unitname GlobalRadio "radiofilename"

Music
PlayMusic = plays a music file
Syntax PlayMusic "musicfilename"
FadeMusic = changes the volume of music. Time is the length the change is to take place over. volume is any number.
volume > 1 = increase volume | volume < 1 = decrease sound
Syntax time FadeMusic volume

Speech / Sounds
Say - gets a unit to say something
Syntax unitname Say "soundfilename"
FadeSound = changes the volume of a sound. Time is the length the change is to take place over. volume is any number.
volume > 1 = increase volume | volume < 1 = decrease sound
Syntax time FadeSound volume
PlaySound = plays a sound
Syntax PlaySound "soundfilename"

I've found INIT fields of units to be unreliable for anything except music. Triggers and waypoint are excellent places to use these commands..
Scripts work fairly well. Just keep it simple. And remember to use pauses so the action doesn't leave before the speaker has finished :).
Wav2Lip only works on wav files, not ogg. So you remember not to delete the base wav file, if you are going to use it.

OK last thing :)
BIS / Codemasters has released the Wav2Lip file, which creates lip synching files. You use these when you have the point-of-view on a unit as it speaks, to get the units lips to move.

Here's a list of files for you to play with.
Sample Mission
Egg Drop Wav-to-Ogg Converter
Wav2Lip


Hangfyre.