StopSound

Definition

StopSound(string soundObjectName1, string soundObjectName2, ..., string soundObjectNameN)

Description

This function stops all ambient and 3D sounds soundObjectName1, soundObjectName2, ,  soundObjectNameN that are playing.

Parameters

soundObjectName1, soundObjectName2, , soundObjectNameN
Specify the name of the ambient and 3D sounds that should stop by this function. You can also use the name “this” for soundObjectName[N]. In this case, “this” refers to the ambient or 3D sound that this script is attached to.

Example

function Init()
    StopSound("this""ambient2""fire1")
end

function Update()

end
Assume that the above script is attached to an ambient sound named “ambient1”. Also, “ambient2” and “fire1” in the example above are ambient and 3D sound names, respectively. In our example, StopSound function stops the current sound (which has a name equivalent to “ambient1”), the ambient sound “ambient2”, and the 3D sound “fire1”.
adminStopSound