Garry's Mod Wiki

SoundData

Description

Table used in sound.Add and sound.GetProperties.

Members

string or sequential table<string> sound
Path to the sound file to be used in this sound effect, relative to sound/ directory (so exclude the sound/ part).

Can be a table of sound files, in which case the sound will be chosen randomly every time from the provided list.

Each sound path can be prepended with a special character for special effects. You can learn more about this here.

string name
The name of the soundscript, to be referenced by in functions such as Entity:EmitSound.
number with CHAN enum channel
The sound channel to play in. See CHAN enum

Default: CHAN_AUTO

number with SNDLVL enum level
The soundlevel of the sound in dB. See SNDLVL enum. This will affect how far the sound can be heard.

Default: SNDLVL_NORM

number or sequential table<number> volume
The volume of the sound as a decimal between 0 and 1. Can be a table of two numbers, a minimum and a maximum value.

Warning: Volume of 0 will act as volume of 1

Default: 1.0

number or sequential table<number> pitch
The pitch of the sound. Can be a table of two numbers, a minimum and a maximum value.

Default: 100

number pitchstart
The initial pitch.

We advise against using this. It may be changed or removed in a future update. Use pitch instead.

Default: 100

number pitchend
The pitch end.

We advise against using this. It may be changed or removed in a future update. Use pitch instead.

Default: 100