Packagecom.aispeech.audio
Classpublic class SoundManager
InheritanceSoundManager Inheritance Object

Sound manager, should be used as a singleton Provides only static methods/fields



Public Methods
 MethodDefined By
  
Constructor
SoundManager
  
getVolume(index:int):Number
[static] return volume of the given channel
SoundManager
  
mute(toMute:Boolean):void
[static] Mute all sounds
SoundManager
  
play(index:uint, startPosition:uint = 0, loops:uint = 0):void
[static] Play a registered sound
SoundManager
  
registerSound(sound:Sound):uint
[static] Register a sound asset to the sound manager
SoundManager
  
setAllVolume(volume:Number):void
[static] change all sounds' volume TODO change name, use setVolume method
SoundManager
  
setVolume(volume:Number, index:int):void
[static] set volume of the given channel
SoundManager
  
stop(index:uint):void
[static] Stop a registered sound
SoundManager
Constructor Detail
SoundManager()Constructor
public function SoundManager()

Constructor

Method Detail
getVolume()method
public static function getVolume(index:int):Number

return volume of the given channel

Parameters

index:int

Returns
Number — volume, 0-1
mute()method 
public static function mute(toMute:Boolean):void

Mute all sounds

Parameters

toMute:Boolean — To mute? true or false

play()method 
public static function play(index:uint, startPosition:uint = 0, loops:uint = 0):void

Play a registered sound

Parameters

index:uint — Registration index
 
startPosition:uint (default = 0) — Start position
 
loops:uint (default = 0) — Number of loops

registerSound()method 
public static function registerSound(sound:Sound):uint

Register a sound asset to the sound manager

Parameters

sound:Sound

Returns
uint — Registration index, used to play/stop etc methods
setAllVolume()method 
public static function setAllVolume(volume:Number):void

change all sounds' volume TODO change name, use setVolume method

Parameters

volume:Number — To mute? true or false

setVolume()method 
public static function setVolume(volume:Number, index:int):void

set volume of the given channel

Parameters

volume:Number — 0~1
 
index:int

stop()method 
public static function stop(index:uint):void

Stop a registered sound

Parameters

index:uint — Registration index