Skip to main content

<pc-sounds>

The <pc-sounds> tag is used to define a sound component.

note

Attributes

AttributeDescription
distance-modelThe distance model of the sound. Can be exponential, inverse or linear. If not specified, linear is used.
pitchThe pitch of the sound. If not specified, 1 is used.
max-distanceThe maximum distance from the listener at which audio falloff stops. If not specified, 10000 is used.
positionalValueless attribute. If present, the sound is positional.
ref-distanceThe distance from the listener at which the volume will be at full volume. If not specified, 1 is used.
roll-off-factorThe factor used in the falloff equation. If not specified, 1 is used.
volumeThe volume of the sound. If not specified, 1 is used.

Example

<pc-entity>
<pc-sounds>
<pc-sound asset="music"></pc-sound>
</pc-sounds>
</pc-entity>

JavaScript Interface

You can programmatically create and manipulate <pc-sounds> elements using the SoundComponentElement API.