Skip to main content

SoundManager <Channel, SoundName>

Manage Sound volume levels without mutating the original Sound objects

Implements

Index

Constructors

constructor

Properties

public_muted

_muted: Set<Sound> = ...

publicchannel

channel: ChannelCollection<Channel>

Accessors

publicdefaultVolume

  • get defaultVolume(): number
  • set defaultVolume(volume: number): void
  • Returns number

  • Parameters

    • volume: number

    Returns void

Methods

public_getEffectiveVolume

  • _getEffectiveVolume(sound: Sound): number
  • Parameters

    Returns number

public_isMuted

  • _isMuted(sound: Sound): boolean
  • Parameters

    Returns boolean

publicaddChannel

  • Apply a list of channels to a sound instance


    Parameters

    Returns void

publicgetSound

publicgetSounds

  • getSounds(): readonly Sound[]

publicgetSoundsForChannel

publicgetVolume

  • getVolume(soundName: SoundName): number
  • Gets the volumn for a sound


    Parameters

    • soundName: SoundName

    Returns number

publicmute

  • mute(name?: SoundName): void
  • Parameters

    • optionalname: SoundName

    Returns void

publicplay

  • play(soundName: SoundName, volume?: number): Promise<void>
  • Parameters

    • soundName: SoundName
    • volume: number = ...

    Returns Promise<void>

publicremoveChannel

publicsetVolume

  • setVolume(soundname: SoundName, volume?: number): void
  • Parameters

    • soundname: SoundName
    • volume: number = ...

    Returns void

publicstop

  • stop(name?: SoundName): void
  • Parameters

    • optionalname: SoundName

    Returns void

publictoggle

  • toggle(name?: SoundName): void
  • Parameters

    • optionalname: SoundName

    Returns void

publictrack

publicunmute

  • unmute(name?: SoundName): void
  • Parameters

    • optionalname: SoundName

    Returns void

publicuntrack

  • untrack(soundName: SoundName): void
  • Remove the maximum volume for a sound, will be 100% of the source volume

    Untracks the Sound in the sound manager


    Parameters

    • soundName: SoundName

    Returns void