new window.PS.sound()
source/controller/SoundController.js, line 24
Sound controller manage audio engine
Extends
- starsGDK.Class
Methods
-
staticwindow.PS.sound.clearSoundQueue()
source/controller/SoundController.js, line 760 -
Clear sound queue
-
staticwindow.PS.sound.disableAudioPermanently()
source/controller/SoundController.js, line 897 -
Disable audio permanently if client environment cannot play sounds After disabling, client will ignore container audio settings updates and disable in-game audio settings
-
staticwindow.PS.sound.disableMusicInGame()
source/controller/SoundController.js, line 819 -
Disable music in game
-
staticwindow.PS.sound.disableSoundInGame()
source/controller/SoundController.js, line 776 -
Disable all sounds in game
-
staticwindow.PS.sound.disposeAllSounds(type)
source/controller/SoundController.js, line 183 -
Dispose all created/cached sounds on locale change
Name Type Description typeString voice|alert|sound|background -
staticwindow.PS.sound.enableAudioPermanently()
source/controller/SoundController.js, line 907 -
Enable audio permanently After enabling, client will update audio settings from container and will enable in-game audio settings
-
staticwindow.PS.sound.enableMusicInGame()
source/controller/SoundController.js, line 799 -
Enable music in game
-
staticwindow.PS.sound.enableSoundInGame()
source/controller/SoundController.js, line 767 -
Enable all sounds in game
-
staticwindow.PS.sound.fadeFromTo(soundId, from, to, duration, callback)
source/controller/SoundController.js, line 453 -
Fade currently playing sound.
Name Type Description soundIdString fromNumber volume to fade from (range 0 to 1). toNumber volume to fade to (range 0 to 1). durationNumber time in milliseconds to fade. callbackfunction fired when the fade is complete. -
staticwindow.PS.sound.hasLoopingAudio(soundId)
source/controller/SoundController.js, line 641 -
Return if there's looping audio playing
Name Type Description soundIdNumber -
staticwindow.PS.sound.isAudioDisabledPermanently(){Boolean}
source/controller/SoundController.js, line 792 -
Return boolean if game audio disabled permanently
Returns:
Type Description Boolean -
staticwindow.PS.sound.isInGameMusicEnabled(){Boolean}
source/controller/SoundController.js, line 915 -
Return boolean if game music enabled
Returns:
Type Description Boolean -
staticwindow.PS.sound.isInGameSoundEnabled(){Boolean}
source/controller/SoundController.js, line 784 -
Return boolean if game sound enabled
Returns:
Type Description Boolean -
staticwindow.PS.sound.isRegularAudio(soundId){Boolean}
source/controller/SoundController.js, line 501 -
Check if this is regular audio
Name Type Description soundIdString Returns:
Type Description Boolean -
staticwindow.PS.sound.isSoundPlaying(soundId){Boolean}
source/controller/SoundController.js, line 437 -
Check if sound is playing.
Name Type Description soundIdString soundId Returns:
Type Description Boolean -
staticwindow.PS.sound.muteAllSounds()
source/controller/SoundController.js, line 834 -
Mute all sounds and music in game
-
staticwindow.PS.sound.pauseAllSounds()
source/controller/SoundController.js, line 854 -
Pause all sounds in game
-
staticwindow.PS.sound.playSound(soundId, loop, priority, link, startCallback, endCallback, fadeIn, fadeInDuration)
source/controller/SoundController.js, line 318 -
Plays sound. If multiple files defined it will pick a random file to play
Name Type Description soundIdString soundId loopBoolean priorityNumber 1 - high priority linkString random url already selected, use that one (used with animationQueue or sequence) startCallbackfunction endCallbackfunction fadeInBoolean true if you want looping background music to fade in fadeInDurationNumber Time in ms to fade in, defaults to 300ms -
staticwindow.PS.sound.registerKillableSoundEffect(soundId)
source/controller/SoundController.js, line 750 -
Call this function to add register killable sound
Name Type Description soundIdString -
staticwindow.PS.sound.registerNonDuplicatingSound(soundId)
source/controller/SoundController.js, line 738 -
Call this function to add sound to non-duplicate list
Name Type Description soundIdString -
staticwindow.PS.sound.resumeAllSounds()
source/controller/SoundController.js, line 876 -
Resume all sounds and music in game
-
staticwindow.PS.sound.setSoundVolume(soundId, volume)
source/controller/SoundController.js, line 481 -
Set the sound volume..
Name Type Description soundIdString volumeNumber volume, range from 0 to 1 -
staticwindow.PS.sound.stopActiveSounds()
source/controller/SoundController.js, line 648 -
Stop all active sounds
-
staticwindow.PS.sound.stopAllKillableSounds()
source/controller/SoundController.js, line 655 -
Stops all sounds with killable option defined in the audioconfig.
-
staticwindow.PS.sound.stopAllLoopingAudios()
source/controller/SoundController.js, line 630 -
Kill all looping audios and remove all pending bg musics.
-
staticwindow.PS.sound.stopLoopingAudio(soundId)
source/controller/SoundController.js, line 609 -
Stop looping audio
Name Type Description soundIdNumber -
staticwindow.PS.sound.stopSound(soundId)
source/controller/SoundController.js, line 668 -
Stop specific sound
Name Type Description soundIdNumber -
staticwindow.PS.sound.unmuteAllSounds()
source/controller/SoundController.js, line 844 -
Unmute all sounds and music in game