Class Sound

Classdesc

Sound class, used for playing sounds in a scene

Constructors

Properties

audios: HTMLAudioElement[]

List of all audio elements that are playing the sound

loop: boolean

True if the audio loops, false otherwise

playbackRate: number

The rate of playback of the audio

playing: boolean

True if the sound is currently playing on the base source. False otherwise

ready: boolean

Boolean if the audio is ready to play

sound: HTMLAudioElement

A reference to the HTMLAudioElement that actually plays the sound

volume: number

The volume that the sound plays at. Value 0-1 where 0 is muted and 1 is full volume. In order to get more volume from the sound, do amplifyMedia(mySound.sound,x) where X is the volume multiplier

wantsToPlay: boolean

Boolean, true if the play() method was called before ready became true

Methods

  • Parameters

    • volume: number

    Returns void

Generated using TypeDoc