]>
Music isn't an easy thing to get working. But it can be quite nice if it does work. The down side to music is the massive file sizes your missions will then take up. If multiplayer people will have to download this before they can play.
Operation Flashpoint uses OGG Vorbis. This is a method of compressing audio files, such as MP3.
You will need to take your music piece and convert it into OGG. If you have something such as SoundForge you can do this straight out, but if you can only save WAV files then you will need a converter such as Ogg Convertor.
Operation Flashpoint is still even more picky and you have to use:
44KHz, 16-bit, 64Kbps - Stereo or Mono. For custom radio you have to use Mono, but this tutorial is for music, so it doesn't matter.
Locate your mission directory:
<flashpoint>\Users\<username>\[MP]missions\<mymission>\
Create a sub-directory called "music" and put your music files (in ogg format) into this directory, keep the file names simple.
You then need to create file called description.ext. Open this file in a text editor and add the following to the bottom of it:
class CfgMusic { tracks[]={mytrack1,mytrack2}; // declaring the music file's name class mytrack1 // the actual declaration { name = ""; // declares which ogg file to use sound[] = {\music\track1.ogg, db+30, 1.0}; }; class mytrack2 { name = ""; sound[] = {\music\track2.ogg, db+30, 1.0}; }; };
The first bit 'tracks[]' has an array with two tracks defined. The following bits are the details for each of these tracks. Name can be left blank, but the 'sound[]' bit has to be correct.
sound[] contains: filename, volume (db+30 is good), pitch (leave it, unless you want chipmunks singing).
To start the music you need to run the following command. This can be done in a script, or in any init or activation field for units/waypoints/triggers:
playMusic "mytrack1"
Obviously replacing mytrack1 with the name of your track.