SoundChannel
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
name: string
audioContext: AudioContext
master: AudioNode
optionaloptions: Omit<SoundChannelOptions<string>, name>
Returns SoundChannel
Properties
publicreadonlyaudioContext
publicreadonlyinput
Gain node every sound in the channel connects to
publicmaxConcurrentTracks
Maximum number of simultaneously playing tracks in this channel, default Infinity
publicreadonlyname
publicreadonlyoutput
Output gain node that carries the channel volume and mute, connected to the manager's master input
publicvoiceStealing
What happens when a maxConcurrentTracks cap
*false (default) drops the new play
*true stops the oldest playing track in that scope to make room for it.
Accessors
publicmuted
Returns boolean
publicsounds
Sounds currently routed through this channel
Returns readonly Sound<string>[]
publicvolume
Channel volume [0-1], default 1
Returns number
Parameters
volume: number
Returns void
Methods
publicmute
Global mute, mutes all sounds managed by the SoundManager by muting the master output node
Returns void
publicplayingCount
Number of currently-playing tracks across the channel's sounds
Returns number
publictoggle
Returns void
publicunmute
Global unmute, unmutes all sounds managed by the SoundManager by setting the gain on the master output node to SoundManager.volume. Warning Does not unmute specifically muted channels
Returns void
A group of sounds with a shared gain stage:
input → output → SoundManager.output.Every sound in the channel is mixed into SoundChannel.input; SoundChannel.output carries the channel volume and mute. Insert Web Audio effects between the two to process the whole channel at once:
const music = manager.getChannel('music'); const muffle = music.audioContext.createBiquadFilter(); muffle.type = 'lowpass'; music.input.disconnect(); music.input.connect(muffle).connect(music.output);