Represents the resource of an audio asset.
new Sound(resource:
| AudioBuffer
| HTMLAudioElement): Sound
Create a new Sound instance.
If the Web Audio API is supported, pass an AudioBuffer object, otherwise an Audio object.
AudioBuffer | HTMLAudioElement
audio:
| undefined
| HTMLAudioElement;
If the Web Audio API is not supported this contains the audio data.
buffer:
| undefined
| AudioBuffer;
If the Web Audio API is supported this contains the audio data.
get duration(): number
Gets the duration of the sound. If the sound is not loaded it returns 0.
number