This chapter will attempt to describe how the sound.cfg file is structured. For the official documentation, please refer to the Microsoft SDK. FS2004 or FS2002 will be used in the examples, although the data applies almost equally to other versions of FS.
At its most basic form, Microsoft Flight Simulators use a sound.cfg file to associate flight simulation sound Events with audio wave files on disk. DirectX is used to play the files. The sound.cfg file is grouped into Sections such as SOUND_ENGINE, with related sound events grouped together.
FS searches for wave files in two directories, the named local Sound folder specified in the aircraft.cfg file, and the system Sound folder. FS2002/ and CFS2 allow you to associate a different Sound folder for each Panel (or share the same one). Thus you could have two aircraft with a common Panel but with two different sound configurations. At runtime, you select the one you want in FS by using the UI Variation listed in the FS menu.
Sounds have Parameters which modify how and when they are heard. An example is the Viewpoint parameter. This specifies whether the sound being defined is heard inside the cockpit, or in views outside the cockpit, for example the Tower View. Thus we can have different sounds heard for a stall warning: a normal one inside the cockpit; and perhaps a very faint one heard if our view is outside the cockpit.
One of the Parameters that determine when and how a sound is played is the FLAGS parameter. Flags associate different sounds with different specific occurrences in FS. For example, FLAGS can be set so that a specific engine sound only occurs when the engine is Damaged, or in CFS3 when Boost is applied to the engine.
Further Parameters can change the Volume and Rate of sounds, depending on airspeed or engine RPM. An example is wind sound. The sound can be programmed to more realistically sound louder as the airspeed increases by specifying a initial Volume at a Minimum Speed, and a louder Volume at a Maximum Speed.
More sophisticated Parameters allow a Volume Envelope and Rate Envelope to be defined. This allows the mixing of sounds, as a sound can be defined to be heard only over a section of the total RPM range of an engine. This allows the creation of Sound Lists, where multiple wav files are combined to create one sound. They are combined based on their volume Envelopes. This allows better modelling of complex sounds such as Engines.
With all of these parameters, it's usually not necessary to edit the wave file itself. With proper selection of parameters, you can modify to wave file to get your desired sound.
Some sounds use multiple wave files in a different way. For example, the Crash sound can have multiple wave files defined. When a crash occurs, FS will randomly pick one of the sounds to play.
FS Sound Studio allows you to see and modify these parameters using a graphical user interface. It also allows you to hear your changes in real time, so you can very quickly produce your desired sound effects.
For more details on sound configurations, please see the Microsoft SDKs.
Sound.cfg file Examples
A Simple Example - STALL_WARNING
A simple example is the stall warning sound. During flight, if the aircraft stalls, the .wav file associated with this event is played for as long as the aircraft is stalled. The config file stall warning event is STALL_WARNING. The viewpoint is set so the sound is heard only inside the cockpit. The C172 stall sound definition looks like this in the sound.cfg file:
The wave file used to represent wind would not sound right if it were to be played at a constant volume and pitch -- the wind noise in the C172 should not sound the same at 50 knots as it does at 120 knots. Also, as the airspeed increases, the pitch of the sound should also increase. This is accomplished by specifying minimum and maximum speeds, volumes and rates for the sound. This is how it looks for the default C172:
In this case, at airspeeds at or below 40 knots, the sound is played at a volume of 6000 ( 0 is minimum, 10000 is maximum), and a rate or pitch of 0.60 of the raw file. At airspeeds at or above 120 knots, the sound is played at a volume of 8500, and a rate of 0.90. Between these two airspeeds, the volume and rate are interpolated, and will fall somewhere between the two extremes.
Complex Sound Example - the C172 SOUND_ENGINE
Engine sounds are very complex, and vary dramatically as the RPM and airspeed varies. FS breaks down the total sound into multiple components to allow many wav files to mix together -- this more accurately conveys the sound. The C172 (and all single engine prop planes) can specify up to 6 predefined sound types or events in the SOUND_ENGINE section of the sound.cfg file. The SOUND_ENGINE section of the C172 looks like this:
The number_of_engines value is self explanatory. We then have 3 events that have defined sounds, start, shutdown, and combustion start. These sounds are only played at specific times (such as shutdown, of course) and are fairly simple, although they can be defined by a Sound List of multiple wave files. In practice they are normally defined by a Sound List with two items, an external viewpoint sound, and an internal, in-cockpit sound.
Finally we have the most complex section of a sound.cfg file -- three Sounds which play all the time the engine is running. Sounds representing the prop, for combustion noises, and for non-combustion, "mechanical" noises. If you're creating your own sound configuration, you may not be able to supply accurate sounds for each, but a satisfactory effect can be had by mixing a sound list of about 4 files for just combustion. Take a look at existing aircraft to see how other designers are dealing with this.
To further our example, let's take a look at the C172 ENG1_COMBUSTION sounds. They're defined by a Sound List named COMBUSTION.1.00. If we take a look at this entry in the sound.cfg file, we see the following:
Note the viewpoint (internal to the cockpit) and filename for the wave file. We also have both a Volume and Rate envelope defined. If we were to plot these out, we'd see the following:
As the RPM of the engine increases the Volume of this wave file is played at about a constant value. At about 11% of the maximum engine RPM, the sound decreases in volume until at about 25% of maximum RPM, it's inaudible. The rate or pitch of the sound increases slightly as the RPM increases.
If this were the only entry in the Sound List, you'd only hear the engine as it was idling, as the throttle was increased, the sound would fade out. However, note the link value. This tells FS that this sound list has another entry, COMBUSTION.1.01. Looking at this entry in the sound.cfg, we see the following: