API Reference

Class List

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

Gets the duration of the sound.

Details

Constructor

Sound(resource)

Create a new Sound instance.

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

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