CSoundEngine

Sound engine.
Can either play sounds given to it directly, or use sound replacement to look up a replacement sample.

Type: Reference type

Methods

Declaration Description
void PrecacheSound(const string& in szFilename) Precaches the given sound.
Must be called in MapInit
void PrecacheSound(CBaseEntity@ pEntity, const string& in szFilename) Precaches the given sound for the given entity. Supports entity sound replacement.
Must be called in MapInit
string FindSoundReplacementSample(CBaseEntity@ pEntity, const string& in szSample) const Finds the sound replacement sample for the given entity and sample.If the sample is replaced, it will return the sample used instead. Otherwise, szSample is returned.
void PlaySound(edict_t@ entity, SOUND_CHANNEL channel, const string& in sample,float volume, float attenuation, int flags = 0, int pitch = PITCH_NORM,int target_ent_unreliable = 0, bool setOrigin = false, const Vector& in vecOrigin = g_vecZero) Plays the given sound with the given parameters. Sound replacement is not used here.
void StopSound(edict_t@ entity, SOUND_CHANNEL channel, const string& in szSample, const bool fUseSoundReplacement = true) Stops the given sound on the given entity on the given channel. If the sound was started using PlaySound, set fUseSoundReplacement to false.
void EmitSoundDyn(edict_t@ entity, SOUND_CHANNEL channel, const string& in szSample,float flVolume, float flAttenuation, int iFlags = 0, int iPitch = PITCH_NORM, int target_ent_unreliable = 0) Plays the given sound with the given parameters. Sound replacement will affect this.
void EmitSound(edict_t@ entity, SOUND_CHANNEL channel, const string& in szSample, float flVolume, float flAttenuation) Plays the given sound with the given parameters. Sound replacement will affect this.
void EmitSoundSuit(edict_t@ entity, const string& in szSample) Play a specific sentence over the HEV suit speaker - just pass player entity, and !sentencename.
void EmitGroupIdSuit(edict_t@ entity, int isentencereg) Play a sentence, randomly selected from the passed in group id, over the HEV suit speaker.
void EmitGroupNameSuit(edict_t@ entity, const string& in szSample) Play a sentence, randomly selected from the passed in groupname.
int LookupSentenceIndex(const string& in sentenceName) Looks up the sentence index of the given sentence
int LookupSentenceGroupIndex(const string& in szGroup) Looks up the sentence group index of the given sentence
int PlaySentenceGroup(edict_t@ entity, const string& in szGroupName, float volume, float attenuation, int flags, int pitch) Plays a sentence group
int PlaySentenceGroup(edict_t@ entity, int iGroupIndex, float volume, float attenuation, int flags, int pitch) Plays a sentence group
int PlaySentenceGroupSequential(edict_t@ entity, const string& in szGroupName,float volume, float attenuation, int flags, int pitch, int ipick, const bool bReset) Plays a sentence group sequentially
void EmitAmbientSound(edict_t@ entity, const Vector& in vecOrigin, const string& in szSample,float flVolume, float flAttenuation, int fFlags, int iPitch) Plays a sentence group sequentially
float PlayHitSound( TraceResult& in tr, const Vector& in vecSrc, const Vector& in vecEnd, int iBulletType ) Plays a hit sound based on the trace result's hit target. Returns the volume at which the hit is being played.
char FindMaterialType(const string& in szMaterial) const Maps the texture name to a material type. See the TextureType enum.