Skip to main content

<pc-sound>

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

Usage
  • It must be a direct child of a <pc-sounds> component.

Attributes

AttributeTypeDefaultDescription
assetString-Audio asset ID (must reference an audio type asset)
auto-playFlag-Whether the sound plays automatically
durationNumber-Duration of the sound in seconds
loopFlag-Whether the sound loops
nameString-Name identifier for the sound slot
overlapFlag-Whether sounds can overlap when triggered multiple times
pitchNumber"1"Pitch multiplier (1 = normal pitch)
start-timeNumber"0"Start time offset in seconds
volumeNumber"1"Volume level (0-1)

Example

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

JavaScript Interface

You can programmatically create and manipulate <pc-sound> elements using the SoundElement API.