Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WAudio

Hierarchy

  • WAudio

Index

Constructors

constructor

  • Returns WAudio

Properties

fadingIn

fadingIn: boolean = false

fadingOut

fadingOut: boolean = false

Private fileFormat

fileFormat: string = "mp3"

Private music

music: object

Type declaration

  • [index: string]: HTMLAudioElement

Private musicPlaylist

musicPlaylist: Array<string> = ["shipwrecked", "darkerworld", "thefirstspark", "nomadsheartbeat", "thewildborn", "nightowl", "savage", "underworld", "shuddersounds"]

musicSpeed

musicSpeed: number = 1

Private musicTrack

musicTrack: number = 0

Private sfx

sfx: object

Type declaration

  • [index: string]: HTMLAudioElement

Private soundDelay

soundDelay: number = 0

Private soundList

soundList: any[] = []

Methods

fadeIn

  • fadeIn(): void
  • Returns void

fadeOut

  • fadeOut(): void
  • Returns void

nextTrack

  • nextTrack(): void
  • Returns void

Private play

  • play(mediaElement: HTMLMediaElement): void
  • Parameters

    • mediaElement: HTMLMediaElement

    Returns void

playEffect

  • playEffect(sound: SfxType, speed?: number): void
  • Parameters

    • sound: SfxType
    • Default value speed: number = 1

    Returns void

playMusic

  • playMusic(): void
  • Returns void

processEffects

  • processEffects(): void
  • Returns void

queueEffect

  • queueEffect(soundEffect: SfxType, delay?: number, speed?: number): void
  • Parameters

    • soundEffect: SfxType
    • Default value delay: number = 0
    • Default value speed: number = 1

    Returns void

setUpMusic

  • setUpMusic(track: HTMLAudioElement): void
  • Parameters

    • track: HTMLAudioElement

    Returns void

updateMusicSpeed

  • updateMusicSpeed(speed: number): void
  • Parameters

    • speed: number

    Returns void

updateVolume

  • updateVolume(): void
  • Returns void

Generated using TypeDoc