API Reference

Class List

pc.Sound

Represents the resource of an audio asset.

Summary

Properties

audio

If the Web Audio API is not supported this contains the audio data.

buffer

If the Web Audio API is supported this contains the audio data.

duration

Returns the duration of the sound.

Details

Constructor

Sound(resource)

Parameters

resourceHTMLAudioElement, AudioBuffer

If the Web Audio API is supported, pass an AudioBuffer object, otherwise an Audio object.

Properties

HTMLAudioElementaudio

If the Web Audio API is not supported this contains the audio data.

AudioBufferbuffer

If the Web Audio API is supported this contains the audio data.

numberduration

Returns the duration of the sound. If the sound is not loaded it returns 0.