Options
All
  • Public
  • Public/Protected
  • All
Menu
classdesc

Creates a SoundPlayer class.

description

The SoundPlayer Class. Plays audio

since

1.0.0-beta

Hierarchy

  • SoundPlayer

Index

Constructors

constructor

Properties

element

element: HTMLAudioElement

path

path: string

Protected sprites

sprites: Duck.Types.Sound.Sprite[]

Accessors

duration

  • get duration(): number

isMuted

  • get isMuted(): boolean

isPlaying

  • get isPlaying(): boolean

volume

  • get volume(): number

Methods

loop

  • loop(loop?: boolean): void
  • memberof

    Sound

    description

    Sets the loop of the audio

    since

    2.1.0

    Parameters

    • loop: boolean = true

    Returns void

mute

  • mute(): void

pause

  • pause(): void

play

  • play(): void

playSprite

  • playSprite(key: string): void
  • memberof

    Sound

    description

    Plays a sound sprite based on the key

    since

    1.0.0-beta

    Parameters

    • key: string

      Key of the sound sprite

    Returns void

restart

  • restart(): void

seek

  • seek(timeInSeconds: number): void
  • memberof

    Sound

    description

    Seeks the audio

    since

    1.0.0-beta

    Parameters

    • timeInSeconds: number

      Time in seconds to seek to

    Returns void

setPath

  • setPath(path: string): void
  • memberof

    Sound

    description

    Sets the audio src/path

    since

    1.0.0-beta

    Parameters

    • path: string

      Audio src/path

    Returns void

setVolume

  • setVolume(volume: number): void
  • memberof

    Sound

    description

    Sets the volume of the audio

    since

    1.0.0-beta

    Parameters

    • volume: number

    Returns void

stop

  • stop(): void

unmute

  • unmute(): void

Generated using TypeDoc