SOUND.INI
Registers sound IDs and defines each one's samples, loudness, priority, range, and playback behavior.
- Kind
- Configuration file
- Filename
SOUND.INI,SOUND01.INI
The game reads SOUND.INI and SOUND01.INI at startup and combines them into one set of sound definitions. Both files are read whether or not Firestorm is installed. The Sound and SoundExpansion keys in OPENTS.INI can name other files.
Either file on its own is enough. If neither file can be read, the game does not start.
Any section or key can appear in either file. When both files set the same key in the same section, the value from SOUND01.INI is used. A key that only one file sets keeps that file’s value. This applies to [General], [Defaults] and [SoundList] as well as to the sound sections.
[General]Channels=16
[Defaults]Priority=NORMALLimit=3
[SoundList]0=MYALERT1=MYLOOP
[MYALERT]Priority=100
[MYLOOP]Sounds=LOOPIN LOOPBODY1 LOOPBODY2 LOOPOUTControl=LOOP RANDOM ATTACK DECAYLoop=4Delay=250 750Range=20Limit=1MYALERT has no Sounds=, so it plays the sample named MYALERT, with priority 100 and every other value from [Defaults]. MYLOOP plays LOOPIN, then one of LOOPBODY1 and LOOPBODY2 four times with 250 to 750 milliseconds of silence between the cycles, then LOOPOUT. The body sample is chosen once, so all four cycles play the same one. Only one copy of MYLOOP plays at a time, and when it plays at a place on the map it fades out over the 20 cells beyond the edge of the view.
[SoundList]
Section titled “[SoundList]”Each value in [SoundList] registers one sound ID. The name to the left of = only identifies the entry. Keys that name a sound use this ID, in any letter case. An unregistered name is ignored. A key that takes one sound keeps the value it had, and a list of sounds leaves the name out.
A sound’s settings come from the section named after its ID. Without such a section, the sound plays the sample named like the ID, with the values from [Defaults].
Entries merge by the name to the left of =, as every other key does. An entry 0=MYSOUND in SOUND01.INI therefore replaces the entry named 0 in SOUND.INI, and the sound that the SOUND.INI entry named is registered only if another entry also lists it. Give entries you add to one file names the other file does not use. An entry with an empty value is ignored, so it cannot remove an entry from the other file.
Sounds are numbered from 0 in the order they are registered. The SOUND.INI entries that SOUND01.INI does not replace come first, in their order, followed by every SOUND01.INI entry in its order. An ID listed twice is registered once, at its first position. A map trigger that plays a sound stores this number, and so does a save game for each endlessly looping sound a trigger left at a waypoint. Adding, removing or moving an entry ahead of a sound changes which sound those triggers and saves play.
A sound registered as IONSTORM replaces the storm music during an ion storm when the game finds a file it can play for at least one of its samples: it plays for the whole storm while the music plays on at a lower level. Give it LOOP in Control=. The shipped files register no such sound.
Samples
Section titled “Samples”Each name in Sounds= is a sample file name without its extension. A sound without Sounds= has one sample, named like its ID. Sound effects gives the order in which the game tries the extensions, and covers missing samples, the size limit, and how long a decoded sample stays in memory.
A loose file is used instead of an archive member with the same name and extension. The extension order comes first, so an archived MYGUN.WAV is used before a loose MYGUN.AUD.
[General]
Section titled “[General]”[General] holds Channels=, the number of sound effects that can play at once.
[Defaults]
Section titled “[Defaults]”[Defaults] sets the value that every sound section uses for a key it omits. It accepts every sound-section key except Sounds=. A key that [Defaults] also omits takes the default shown for it under Accepted settings.
A key that a sound section sets replaces the [Defaults] value. The flags in Type= and Control= are not added to those in [Defaults].
A sound section that sets Control= without Attack= has one attack sample when its Control= includes ATTACK, and none otherwise, whatever [Defaults] sets for Attack=. Decay= and DECAY work the same way.
Sound sections
Section titled “Sound sections”A sound section is read only when its name is a sound ID registered in [SoundList]. Its keys are listed under Accepted settings, and each key’s page gives its values and default.
The keys and the flag names in Type= and Control= follow Yuri’s Revenge. Separate flags with spaces or commas. A flag the game does not recognize is left out. A value in which no flag is recognized still replaces the [Defaults] flags, leaving the sound with none.
Sound effects explains how the keys work together when a sound plays: which samples play, how a sound at a place on the map fades and pans, and how sounds compete for voices.
Files written for Tiberian Sun
Section titled “Files written for Tiberian Sun”The sound files shipped with Tiberian Sun and Firestorm read without changes. Their sound sections set at most Priority=. An integer priority is kept as written, so a sound with a higher number still wins a voice over one with a lower number. Every other key takes its default. Each shipped sound is therefore a one-shot at full volume, with up to three copies playing at once. When it plays at a place on the map, it fades out over the 28 cells beyond the edge of the view.
Sections copied from a Yuri’s Revenge file also read, with two differences:
Volume=1is full volume, where Yuri’s Revenge reads it as one percent.- A
Delay=number without a decimal point is in milliseconds. Write a delay in seconds with a decimal point, such asDelay=5.0 15.0.
A Volume= above 1 written for an earlier OpenTS release now reads as a percentage; Volume= explains what to change.
Accepted settings
15 of 15
| Key | Description | Value | When omitted |
|---|---|---|---|
Attack[<Sound ID>] | integer | Context-dependent | |
Control[<Sound ID>] | string | NORMAL | |
Decay[<Sound ID>] | integer | Context-dependent | |
Delay[<Sound ID>] | string | 0 | |
FShift[<Sound ID>] | string | 0 | |
Limit[<Sound ID>] | integer | 3 | |
Loop[<Sound ID>] | integer | 0 | |
LoopLimit[<Sound ID>] | integer | 0 | |
MinVolume[<Sound ID>] | string | 0 | |
Priority[<Sound ID>] | How firmly a team holds its members against other teams, or how hard a sound competes for a playback channel. | string | 10 |
Range[<Sound ID>] | How far the weapon may be fired, in cells, or how far from the view a sound is still heard. | integer | 28 |
Sounds[<Sound ID>] | string | Computed | |
Type[<Sound ID>] | A superweapon's hard-coded behavior, the object kind named for the playback trap under the sync-bug settings, or where a sound is heard from. | string | SCREEN |
Volume[<Sound ID>] | The share of full loudness a sound effect or a music track is played at. | string | 1.0 |
VShift[<Sound ID>] | string | 0 |
No keys match the current filters.
Source files
Linked at revision 51b52aa38392.
History
- Changed0.2.0In development
- Changed0.2.0In development
- Changed0.2.0In development
- Changed0.2.0In development