Class: Sound

pc.Sound

Represents the resource of an audio asset.

Constructor

new Sound(resource)

Parameters:
Name Type Description
resource Audio | AudioBuffer If the Web Audio API is supported, pass an AudioBuffer object, otherwise an Audio object.
Properties:
Name Type Description
buffer AudioBuffer If the Web Audio API is supported this contains the audio data
audio Audio If the Web Audio API is not supported this contains the audio data
duration Number Returns the duration of the sound. If the sound is not loaded it returns 0.
Source: