| Package | com.bourre.media.sound |
| Class | public class MixSoundFactory |
| Inheritance | MixSoundFactory SoundFactory |
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
You can control the SoundFactory with :
a master volume
gain of a sound ( relative to the master volume)
pan of a sound
For instance, if the master volume is to 0.5 and the gain of a sound to 0.5
the real volume for this sound is 0.25.
| Method | Defined by | ||
|---|---|---|---|
| MixSoundFactory | |||
|
addSound(id:String):void
Add a new sound.
| MixSoundFactory | ||
|
addSounds(a:Array):void
Adds a list of sounds.
| MixSoundFactory | ||
![]() |
clear():void
Stops all sounds, clears sounds lists and reset : you must reinitialise it after with init().
| SoundFactory | |
![]() |
getActiveChannel(id:String):Array
Return an Array of all SoundChannel instances use by the id passed-in
| SoundFactory | |
![]() |
getAllSounds():Array
Get all Sound instances stored under passed-in sound's class identifier.
| SoundFactory | |
|
getGain(id:String):Number
Get gain : volume for a sound ( 0 to n ).
| MixSoundFactory | ||
|
getPan(id:String):Number
Get Pan of a sound ( -1 to 1 ).
| MixSoundFactory | ||
![]() |
getRegisteredId():Array
Get all sound's class identifier use
| SoundFactory | |
![]() |
getSound(id:String):Sound
Returns a Sound instance stored under passed-in sound's class identifier :
if your SoundFactory isOn() = true : return a Sound or throw a NoSuchElementException if it doesn't exist
if your SoundFactory isOn() = true : return a NullSound
| SoundFactory | |
|
getVolume():Number
Get Master Volume ( 0 to 1 ).
| MixSoundFactory | ||
![]() |
goOff():void
Turns "playing" mode off and stops all currently played sounds.
| SoundFactory | |
![]() |
goOn():void
Turns "playing" mode on.
| SoundFactory | |
![]() |
init(applicationDomain:ApplicationDomain = null):void
Defines passed-in applicationDomain as the sound library's applicationDomain.
| SoundFactory | |
![]() |
isOn():Boolean
Checks if "playing" mode is enable or not.
| SoundFactory | |
![]() |
isPlaying(id:String = null):Boolean
Without argument : it return a Boolean to indicate if there is at least one sound is playing.
| SoundFactory | |
![]() |
isRegistered(id:String):Boolean
Check if a sound is already register
| SoundFactory | |
![]() |
pause():void
Pause all sounds.
| SoundFactory | |
![]() |
playSound(id:String):void
Play a sound simply according to its Class identifier in the library : only if isOn() = true
| SoundFactory | |
![]() |
playSoundLoop(id:String):void
Play a sound in loop ( int.MAX_VALUE times ) according to its Class identifier in the library : only if isOn() = true
| SoundFactory | |
![]() |
removeSound(id:String):void
Removes Sound instance stored under passed-in sound's class identifier.
| SoundFactory | |
![]() |
resume():void
Resume all sounds stopped with pause().
| SoundFactory | |
|
setAllGain(n:Number):void
Set the same gain for all sounds ( 0 to n ).
| MixSoundFactory | ||
|
setAllPan(n:Number):void
Set the same pan for all sounds ( -1 to 1 ).
| MixSoundFactory | ||
|
setGain(id:String, n:Number):void
Set gain : volume for a sound ( 0 to n ).
| MixSoundFactory | ||
|
setPan(id:String, n:Number):void
Set Pan of a sound ( -1 to 1 ).
| MixSoundFactory | ||
|
setVolume(n:Number):void
Set Master Volume ( 0 to 1 ).
| MixSoundFactory | ||
![]() |
stopSound(id:String = null):void
Without argument it stop all channels of all sounds.
| SoundFactory | |
![]() |
toggleOnOff():void
Toggles "playing" mode.
| SoundFactory | |
![]() |
toString():String
Returns the string representation of this instance.
| SoundFactory | |
| MixSoundFactory | () | constructor |
public function MixSoundFactory()
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
| addSound | () | method |
public override function addSound(id:String):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Add a new sound.
Parametersid:String — class identifier in the library
|
See also
| addSounds | () | method |
public override function addSounds(a:Array):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Adds a list of sounds. Add all sounds except for IllegalArgumentException and ClassCastException.
Parametersa:Array — array of sound's class identifier (in the library)
|
See also
| getGain | () | method |
public function getGain(id:String):Number
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Get gain : volume for a sound ( 0 to n ). By default all sounds gain is set to 1 ( equals to 100% ).
Parametersid:String — class identifier in the library
|
Number |
See also
| getPan | () | method |
public function getPan(id:String):Number
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Get Pan of a sound ( -1 to 1 ). By default all sounds pan is set 0 .
Parametersid:String — class identifier in the library
|
Number |
See also
| getVolume | () | method |
public function getVolume():Number
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Get Master Volume ( 0 to 1 ). By default master volume is set to 1.
ReturnsNumber |
See also
| setAllGain | () | method |
public function setAllGain(n:Number):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Set the same gain for all sounds ( 0 to n ). By default all sounds gain is set to 1 ( equals to 100% ).
Parametersn:Number — number between 0 and n for all sound volume
|
See also
| setAllPan | () | method |
public function setAllPan(n:Number):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Set the same pan for all sounds ( -1 to 1 ). By default all sounds pan is 0.
Parametersn:Number — number between -1 and 1 for its volume ( 0 is the center )
|
See also
| setGain | () | method |
public function setGain(id:String, n:Number):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Set gain : volume for a sound ( 0 to n ). By default all sounds gain is set to 1( equals to 100% ).
Parametersid:String — class identifier in the library
|
|
n:Number — number between 0 and n for this sound volume
|
See also
| setPan | () | method |
public function setPan(id:String, n:Number):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Set Pan of a sound ( -1 to 1 ). By default all sounds pan is set to 0.
Parametersid:String — class identifier in the library
|
|
n:Number — number between -1 and 1 for its volume ( 0 is the center )
|
See also
| setVolume | () | method |
public function setVolume(n:Number):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Set Master Volume ( 0 to 1 ). By default master volume is set to 1.
Parametersn:Number — to 1
|
See also