q5play
    Preparing search index...

    Class Sound

    Index

    Constructors

    Properties

    Methods

    Constructors

    • 🔊 Creates a new Q5.Sound object.

      Returns Sound

    Properties

    ended: boolean

    🔊 True if the sound has finished playing.

    loaded: boolean

    🔊 True if the sound data has finished loading.

    loop: boolean

    🔊 Set to true to make the sound loop continuously.

    pan: number

    🔊 Set the sound's stereo position between -1 (left) and 1 (right).

    paused: boolean

    🔊 True if the sound is currently paused.

    volume: number

    🔊 Set the sound's volume to a value between 0 (silent) and 1 (full volume).

    Methods

    • 🔊 Pauses the sound, allowing it to be resumed.

      Returns void

    • 🔊 Plays the sound.

      If this function is run when the sound is already playing, a new playback will start, causing a layering effect.

      If this function is run when the sound is paused, all playback instances will be resumed.

      Use await to wait for the sound to finish playing.

      Returns void

      a promise that resolves when the sound finishes playing

    • 🔊 Stops the sound, resetting its playback position to the beginning.

      Removes all playback instances.

      Returns void