Castle Game Engine: CastleSoundEngine: Class TSoundInfo

# Class TSoundInfo
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleSoundEngine ## Declaration `type TSoundInfo = class(TObject)` ## Description Sound information, internally used by TRepoSoundEngine. The fields correspond to appropriate attributes in sounds XML file. All of the fields except Buffer are initialized only by ReadSounds. From the point of view of end-user the number of sounds is constant for given game and their properties (expressed in `TSoundInfo` below) are also constant. However, for the sake of debugging/testing the game, and for content designers, the actual values of Sounds are loaded at initialization by ReadSounds (called automatically by ALContextOpen) from sounds XML file, and later can be changed by calling ReadSounds once again during the game (debug menu may have command like "Reload sounds/index.xml"). ## Hierarchy TObject TSoundInfo ## Overview ### Fields
| `Name: string;`
| `URL: string;`
| `Gain: Single;`
| `MinGain: Single;`
| `MaxGain: Single;`
| `DefaultImportance: Cardinal;`
## Description ### Fields
| `Name: string;`
Unique sound name. Empty for the special sound stNone.
| `URL: string;`
`URL` from which to load sound data. Empty means that the sound data is not defined, so the OpenAL buffer will not be initialized and trying to play this sound (with methods like TSoundEngine.Sound or TSoundEngine.Sound3D) will do nothing. This is useful if you want to use a sound name in code, but you do not have the actual sound file for this yet.
| `Gain: Single;`
Gain (how loud the sound is). They are mapped directly to respective OpenAL source properties, so see OpenAL specification for exact details what they mean. In short: Gain scales the sound loudness. Use this to indicate that e.g. a plane engine is louder than a mouse squeak (when heard from the same distance). Do not make the actual sound data (in wav, ogg and such files) louder/more silent for this purpose. This is usually bad for sound quality. Instead, keep your sound data at max loudness (normalized), and use this Gain property to scale sound. It can be antything from 0 to +infinity. The default is 1. MinGain and MaxGain force a minimum/maximum sound loudness. These can be used to "cheat" around default distance attenuation calculation. These must be in [0, 1] range. By default MinGain is 0 and MaxGain is 1. Note that Gain value > 1 is allowed. Although OpenAL may clip the resulting sound (after all calculations taking into account 3D position will be done). The resulting sound is also clamped by MaxGain (that generally must be in [0, 1], although some OpenAL implementations allow values > 1). When this sound is used for MusicPlayer.Sound: MinGain, MaxGain are ignored. Effective Gain (passed to OpenAL sound source) is the TMusicPlayer.MusicVolume multiplied by our Gain.
| `MinGain: Single;`
Gain (how loud the sound is). They are mapped directly to respective OpenAL source properties, so see OpenAL specification for exact details what they mean. In short: Gain scales the sound loudness. Use this to indicate that e.g. a plane engine is louder than a mouse squeak (when heard from the same distance). Do not make the actual sound data (in wav, ogg and such files) louder/more silent for this purpose. This is usually bad for sound quality. Instead, keep your sound data at max loudness (normalized), and use this Gain property to scale sound. It can be antything from 0 to +infinity. The default is 1. `MinGain` and MaxGain force a minimum/maximum sound loudness. These can be used to "cheat" around default distance attenuation calculation. These must be in [0, 1] range. By default `MinGain` is 0 and MaxGain is 1. Note that Gain value > 1 is allowed. Although OpenAL may clip the resulting sound (after all calculations taking into account 3D position will be done). The resulting sound is also clamped by MaxGain (that generally must be in [0, 1], although some OpenAL implementations allow values > 1). When this sound is used for MusicPlayer.Sound: `MinGain`, MaxGain are ignored. Effective Gain (passed to OpenAL sound source) is the TMusicPlayer.MusicVolume multiplied by our Gain.
| `MaxGain: Single;`
Gain (how loud the sound is). They are mapped directly to respective OpenAL source properties, so see OpenAL specification for exact details what they mean. In short: Gain scales the sound loudness. Use this to indicate that e.g. a plane engine is louder than a mouse squeak (when heard from the same distance). Do not make the actual sound data (in wav, ogg and such files) louder/more silent for this purpose. This is usually bad for sound quality. Instead, keep your sound data at max loudness (normalized), and use this Gain property to scale sound. It can be antything from 0 to +infinity. The default is 1. MinGain and `MaxGain` force a minimum/maximum sound loudness. These can be used to "cheat" around default distance attenuation calculation. These must be in [0, 1] range. By default MinGain is 0 and `MaxGain` is 1. Note that Gain value > 1 is allowed. Although OpenAL may clip the resulting sound (after all calculations taking into account 3D position will be done). The resulting sound is also clamped by `MaxGain` (that generally must be in [0, 1], although some OpenAL implementations allow values > 1). When this sound is used for MusicPlayer.Sound: MinGain, `MaxGain` are ignored. Effective Gain (passed to OpenAL sound source) is the TMusicPlayer.MusicVolume multiplied by our Gain.
| `DefaultImportance: Cardinal;`
How important the sound is. Influences what happens when we have a lot of sounds playing at once. See TSound.Importance. Ignored when this sound is used for MusicPlayer.Sound.
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:14