class
Sound3d (client-side)
Available since version: 0.1.2
This class represents 3d sound.
Constructor
string fileName
Parameters:
string
fileName: the name of the WAV audio file or SFX script instance.
Properties
float
volume
Available since version: 0.1.10
Represents the sound 3d volume scale in range 0.0 to 1.0.
Setting it to -1
will set the volume to the default value (which is either volume value from sfx script instance or 0.5 approx).
bool
looping
Available since version: 0.1.10
Represents the sound 3d looping feature.
string
file
Available since version: 0.2
Represents the file name of played sound or the name of SFX script instance.
float
playingTime (read-only)
Available since version: 0.1.10
Represents the sound 3d playing time in miliseconds.
float
obstruction
Available since version: 0.1.2
Represents the sound 3d obstruction.
float
radius
Available since version: 0.1.2
Represents the sound 3d radius.
Settting it to -1
will set the radius to the default value (3500).
float
coneAngle
Available since version: 0.1.2
Represents the sound 3d cone angle in range 0.0 to 360.0.
float
reverbLevel
Available since version: 0.1.2
Represents the sound 3d reverb level.
bool
ambient
Available since version: 0.1.2
Represents the sound 3d ambient mode feature.
float
pitchOffset
Available since version: 0.1.2
Represents the sound 3d pitch offset.
Methods
play
Available since version: 0.1.2
This method will play the 3d sound.
void play()
stop
Available since version: 0.1.10
This method will stop the 3d sound.
void stop()
isPlaying
Available since version: 0.1.10
This method is used to check whether the 3d sound is currently playing.
bool isPlaying()
Returns bool
:
true
if the 3d sound is currently playing, otherwise false
.
setTargetVob
Available since version: 0.1.2
This method will set the target vob, from which position the 3d sound will be played.
void setTargetVob(Vob vob)
Parameters:
Vob
vob: the vob object reference.
setTargetPlayer
Available since version: 0.1.2
This method will set the target player/npc, from which position the 3d sound will be played.
void setTargetPlayer(int playerid)
Parameters:
int
playerid: the id of the target player.