SFXDescription

Engine/source/sfx/sfxDescription.h

The SFXDescription defines how a sound should be played.

More...

Public Types

enum
_Anonymous_ {  MaxNumParameters = 8
}

Private Types

Parent 

Public Attributes

The angle in degrees of the inner part of the cone.

The angle in degrees of the outer part of the cone.

The volume scalar for on/beyond the outside angle.

Easing curve for fade-in.

Number of seconds until playback reaches full volume after starting/resuming.

bool

When mIsLooping is true, the fades will apply to each cycle.

Easing curve for fade-out.

Number of seconds to fade out fading before stopping/pausing.

bool

If true the sound will be 3D positional.

bool

If true the sound will loop.

bool

If true the sound data will be streamed from disk and not loaded completely into memory.

The distance from the emitter at which the sound volume becomes zero.

The distance from the emitter at which the sound volume is unchanged.

mParameters [MaxNumParameters]

Parameters to which sources playing with this description should automatically connect when created.

The pitch scale.

Priority level for sounds.

Reverb properties for sound playback.

Local logarithmic distance attenuation rolloff factor.

Max distance in both directions along each axis by which the sound position of a 3D sound will be randomly scattered.

The source to which sources playing with this description will be added.

The number of seconds of sound data to read per streaming packet.

The number of streaming packets to read and buffer in advance.

bool

If this sound is allowed to be mixed in hardware.

bool

If true the sound uses custom reverb properties.

The 0 to 1 volume scale.

Public Functions

Called after any property of the object is changed in the world editor.

bool

Called when the object is added to the sim.

Validates the description fixing any parameters that are out of range.

Public Static Functions

Detailed Description

The SFXDescription defines how a sound should be played.

If mConeInsideAngle and mConeOutsideAngle are not both 360 then the sound will be directional and facing out the Y axis. To reorient the cones, reorient the emitter object.

A few tips:

Make sure that server SFXDescription are defined with the datablock keyword, and that client SFXDescription are defined with the 'new' or 'singleton' keyword.

Public Types

@167

Enumerator

MaxNumParameters = 8

Private Types

typedef SimDataBlock Parent 

Public Attributes

U32 mConeInsideAngle 

The angle in degrees of the inner part of the cone.

It must be within 0 to 360.

This is only valid for 3D sounds.

U32 mConeOutsideAngle 

The angle in degrees of the outer part of the cone.

It must be greater than mConeInsideAngle and less than to 360.

This is only valid for 3D sounds.

F32 mConeOutsideVolume 

The volume scalar for on/beyond the outside angle.

This is only valid for 3D sounds.

EaseF mFadeInEase 

Easing curve for fade-in.

F32 mFadeInTime 

Number of seconds until playback reaches full volume after starting/resuming.

Zero to deactivate (default).

bool mFadeLoops 

When mIsLooping is true, the fades will apply to each cycle.

Otherwise, only the first cycle will have a fade-in applied and no fade-out happens when a cycle ends.

This also affects the playtime that is used to place fades. If mFadeLoops is false, the total playtime so far will be used rather than the playtime of the current cycle. This makes it possible to apply fades that extend across two or more loops of the sound, i.e. are longer than the actual sound duration.

EaseF mFadeOutEase 

Easing curve for fade-out.

F32 mFadeOutTime 

Number of seconds to fade out fading before stopping/pausing.

Zero to deactivate (default).

bool mIs3D 

If true the sound will be 3D positional.

bool mIsLooping 

If true the sound will loop.

bool mIsStreaming 

If true the sound data will be streamed from disk and not loaded completely into memory.

F32 mMaxDistance 

The distance from the emitter at which the sound volume becomes zero.

This is only valid for 3D sounds.

F32 mMinDistance 

The distance from the emitter at which the sound volume is unchanged.

Beyond this distance the volume begins to falloff.

This is only valid for 3D sounds.

StringTableEntry mParameters [MaxNumParameters]

Parameters to which sources playing with this description should automatically connect when created.

F32 mPitch 

The pitch scale.

F32 mPriority 

Priority level for sounds.

Higher priority sounds are less likely to be culled.

SFXSoundReverbProperties mReverb 

Reverb properties for sound playback.

F32 mRolloffFactor 

Local logarithmic distance attenuation rolloff factor.

-1 to use global setting. Per-sound rolloff settings only supported with some SFX providers.

Point3F mScatterDistance 

Max distance in both directions along each axis by which the sound position of a 3D sound will be randomly scattered.

Example: if you set x=5, then the final x coordinate of the 3D sound will be (OriginalX + randF( -5, +5 )).

SFXSource * mSourceGroup 

The source to which sources playing with this description will be added.

U32 mStreamPacketSize 

The number of seconds of sound data to read per streaming packet.

Only relevant if "isStreaming" is true.

U32 mStreamReadAhead 

The number of streaming packets to read and buffer in advance.

Only relevant if "isStreaming" is true.

bool mUseHardware 

If this sound is allowed to be mixed in hardware.

bool mUseReverb 

If true the sound uses custom reverb properties.

F32 mVolume 

The 0 to 1 volume scale.

Public Functions

SFXDescription()

SFXDescription(const SFXDescription & , bool )

SFXDescription(const SFXDescription & desc)

allowSubstitutions()

Reimplemented from: SimObject

DECLARE_CONOBJECT(SFXDescription )

inspectPostApply()

Reimplemented from: SimObject

onAdd()

Reimplemented from: SimDataBlock

packData(BitStream * stream)

Reimplemented from: SimDataBlock

unpackData(BitStream * stream)

Reimplemented from: SimDataBlock

validate()

Validates the description fixing any parameters that are out of range.

Public Static Functions

initPersistFields()