-
-
Notifications
You must be signed in to change notification settings - Fork 4
API
You can control the mixer and soundboard of Soundscape through game.soundscape
. Below you can find the mose useful commands:
The soundscape window can be opened and closed and is accessed through game.soundscape.mixerApp
render
render(true)
Open/render the window: game.soundscape.mixerApp.render(true)
close
close()
Close the window: game.soundscape.mixerApp.close()
The mixer is the basis of Soundscape and is used to start, stop and open soundscapes and channels. It is accessed through game.soundscape
start
start(channel = undefined)
Start either the whole soundscape: game.soundscape.start()
Or a specific (0-based) channel: game.soundscape.start(1)
stop
stop(channel = undefined)
Stop either the whole soundscape: game.soundscape.stop()
Or a specific (0-based) channel: game.soundscape.stop(1)
setSoundscape
setSoundscape(newSoundscape, forceStart = false)
Change to a different soundscape.
You can either use the 0-based soundscape number: game.soundscape.setSoundscape(0)
Or the name of the soundscape: game.soundscape.setSoundscape('Forest')
If Soundscape is already playing, it will start playing the new soundscape. If it is not playing, it will only load the new soundscape. By setting forceStart
to true, it will always start playing the soundscape: game.soundscape.setSoundscape('Forest', true)
You can control each individual channel from game.soundscape.channels[n]
, where n is the 0-based channel number.
The master channel is identical to the normal channels but is accessed from game.soundscape.master
.
setVolume
setVolume(newVolume)
Sets the volume of the channel (0 to 1.25): game.soundscape.channels[0].setVolume(0.5)
setPan
setPan(newPan)
Sets the pan of the channel (-1 to 1): game.soundscape.channels[0].setPan(-0.25)
setMute
setMute(enable)
Mutes or unmutes the channel (true/false): game.soundscape.channels[0].setMute(true)
setSolo
setSolo(enable)
Solos or unsolos the channel (true/false): game.soundscape.channels[0].setSolo(true)
setLink
setLink(enable)
Links or unlinks the channel (true/false): game.soundscape.channels[0].setLink(true)
The soundboard can be accessed from game.soundscape.soundboard
playSound
playSound(soundNr)
Play a sound from the soundboard. The soundNr is 0-based and starts at the top left of the soundboard: game.soundscape.soundboard.playSound(0)
stopAll
stopAll()
Stop all soundboard sounds: game.soundscape.soundboard.stopAll()
setVolume
setVolume(newVolume)
Set the soundboard volume (0 to 1): game.soundscape.soundboard.setVolume(0.5)