new AudioEmitter(clip)
Parameters:
Name | Type | Description |
---|---|---|
clip |
The audio clip to be played by this AudioEmitter. Multiple AudioClips can be added to an Entity. |
Properties:
Name | Type | Description |
---|---|---|
name |
Allows tagging AudioEmitters with a name. For instance: collision sounds could have the name "collision" |
|
autoplay |
If true, playback starts when the component is added. Usually used with looping AudioClips. |
|
coneInnerAngle |
The angle in radians (!!!) of a cone inside of which there will be no volume reduction. |
|
coneOuterAngle |
The angle in radians (!!!) of a cone outside of which the volume will be reduced by a constant value, defined by the coneOuterGain attribute. |
|
coneOuterGain |
The amount of volume reduction outside the cone defined by the coneOuterAngle attribute. Its default value is 0, meaning that no sound can be heard. |
|
distanceModel |
One of |
|
maxDistance |
Represents the maximum distance between the audio source and the listener, after which the volume is not reduced any further. |
|
panningModel |
One of |
|
refDistance |
Representing the reference distance for reducing volume as the audio source moves further from the listener. {@see AudioDistanceModel} |
|
rolloffFactor |
Describes how quickly the volume is reduced as the source moves away from the listener. This value is used by all distance models. {@see AudioDistanceModel} |
Methods
-
clone()
-
Returns:
- Type
- AudioEmitter
-
onAdded()
-
-
onRemoved()
-
-
play( [gain])
-
Starts playback of the audio clip.
Parameters:
Name Type Argument Description gain
Number <optional>
The gain of the volume. If provided, this parameter will override the currently assigned gain of the component.
-
stop()
-
Stops playback of the audio clip.