Packagegs.audio
Classpublic class AudioObject
InheritanceAudioObject Inheritance flash.events.EventDispatcher

The AudioObject class controls any audible object. It can control a sound instance or any object with a soundTransform property.

Examples are in the guttershark repository.

See also

gs.audio.AudioGroup


Public Properties
 PropertyDefined by
  isPaused : Boolean
[read-only] Check whether or not the sound is paused.
AudioObject
  isPlaying : Boolean
[read-only] Check whether or not the sound is playing.
AudioObject
  panning : Number
Panning.
AudioObject
  pixelsToFill : int
The amount of pixels to fill for this audio object.
AudioObject
  pn : Number
A tween property for panning.
AudioObject
  progressTimerInterval : int
The interval for dispatching progress events.
AudioObject
  vl : Number
A tween property for volume.
AudioObject
  volume : Number
Volume.
AudioObject
Public Methods
 MethodDefined by
  
AudioObject(_obj:*)
Constructor for AudioObject instances.
AudioObject
  
decreaseVolume(step:Number = .1):void
Decrease the volume.
AudioObject
  
dispose():void
Dispose of this audible object.
AudioObject
  
get(id:String):AudioObject
[static] Get an audio object.
AudioObject
  
increaseVolume(step:Number = .1):void
Increase the volume.
AudioObject
  
mute():void
Mute.
AudioObject
  
panTo(pan:Number, duration:Number = .3):void
Tween the panning.
AudioObject
  
pause():void
Pause playing.
AudioObject
  
percentPlayed():Number
Get the percentage of the sound that has played.
AudioObject
  
Get the amount of pixels that have played.
AudioObject
  
play(_ops:Object = null):void
Play this audio object.
AudioObject
  
resume():void
Resume playing.
AudioObject
  
seek(position:Number):void
Seek to a position in the sound.
AudioObject
  
seekToPercent(percent:Number):void
Seek to a percent of the sound.
AudioObject
  
seekToPixel(pixel:Number):void
Seek to a pixel (first set pixels to fill).
AudioObject
  
set(id:String, ao:AudioObject):void
[static] Save an audio object.
AudioObject
  
setVolume(level:Number):void
Set the volume.
AudioObject
  
stop():void
Stop playing.
AudioObject
  
toggleMute():void
Toggle mute.
AudioObject
  
unMute():void
Un-mute.
AudioObject
  
unset(id:String):void
[static] Unset (delete) an audio object.
AudioObject
  
volumeTo(level:Number, duration:Number = .3):void
Tween the volume.
AudioObject
Events
 EventSummaryDefined by
   Dispatched when the sound has completed playing.AudioObject
   Dispatched when the sound has looped.AudioObject
   Dispatched when the sound is muted.AudioObject
   Dispatched when the panning changes.AudioObject
   Dispatched when the sound is paused.AudioObject
   Dispatched for progress of the audio.AudioObject
   Dispatched when the sound is resumed.AudioObject
   Dispatched when the sound starts playing.AudioObject
   Dispatched when the sound stops playing.AudioObject
   Dispatched when the sound is un-muted.AudioObject
   Dispatched when the volume changes AudioObject
Property detail
isPausedproperty
isPaused:Boolean  [read-only]

Check whether or not the sound is paused.

Implementation
    public function get isPaused():Boolean
isPlayingproperty 
isPlaying:Boolean  [read-only]

Check whether or not the sound is playing.

Implementation
    public function get isPlaying():Boolean
panningproperty 
panning:Number  [read-write]

Panning.

Implementation
    public function get panning():Number
    public function set panning(value:Number):void
pixelsToFillproperty 
pixelsToFill:int  [read-write]

The amount of pixels to fill for this audio object.

Implementation
    public function get pixelsToFill():int
    public function set pixelsToFill(value:int):void
pnproperty 
pn:Number  [read-write]

A tween property for panning.

Implementation
    public function get pn():Number
    public function set pn(value:Number):void
progressTimerIntervalproperty 
progressTimerInterval:int  [read-write]

The interval for dispatching progress events.

Implementation
    public function get progressTimerInterval():int
    public function set progressTimerInterval(value:int):void
vlproperty 
vl:Number  [read-write]

A tween property for volume.

Implementation
    public function get vl():Number
    public function set vl(value:Number):void
volumeproperty 
volume:Number  [read-write]

Volume.

Implementation
    public function get volume():Number
    public function set volume(value:Number):void
Constructor detail
AudioObject()constructor
public function AudioObject(_obj:*)

Constructor for AudioObject instances.

Parameters
_obj:* — The object to control.
Method detail
decreaseVolume()method
public function decreaseVolume(step:Number = .1):void

Decrease the volume.

Parameters
step:Number (default = .1) — The amount to decrease the volume by.
dispose()method 
public function dispose():void

Dispose of this audible object.

get()method 
public static function get(id:String):AudioObject

Get an audio object.

Parameters
id:String — The audio object id.

Returns
AudioObject
increaseVolume()method 
public function increaseVolume(step:Number = .1):void

Increase the volume.

Parameters
step:Number (default = .1) — The amount to increase the volume by.
mute()method 
public function mute():void

Mute.

panTo()method 
public function panTo(pan:Number, duration:Number = .3):void

Tween the panning.

Parameters
pan:Number — The new pan level.
 
duration:Number (default = .3) — The time it takes to tween the panning.
pause()method 
public function pause():void

Pause playing.

percentPlayed()method 
public function percentPlayed():Number

Get the percentage of the sound that has played.

Returns
Number
pixelsPlayed()method 
public function pixelsPlayed():int

Get the amount of pixels that have played.

Returns
int
play()method 
public function play(_ops:Object = null):void

Play this audio object.

Available options:

Parameters
_ops:Object (default = null) — Play options.
resume()method 
public function resume():void

Resume playing.

seek()method 
public function seek(position:Number):void

Seek to a position in the sound.

Parameters
position:Number — The position of the sound to seek to.
seekToPercent()method 
public function seekToPercent(percent:Number):void

Seek to a percent of the sound.

Parameters
percent:Number — The percent to seek to.
seekToPixel()method 
public function seekToPixel(pixel:Number):void

Seek to a pixel (first set pixels to fill).

Parameters
pixel:Number — The pixel to seek to.
set()method 
public static function set(id:String, ao:AudioObject):void

Save an audio object.

Parameters
id:String — The id of the audio group.
 
ao:AudioObject — The audio group.
setVolume()method 
public function setVolume(level:Number):void

Set the volume. This is a helper method in case you need to use setTimeout with volume.

Parameters
level:Number — The volume level.
stop()method 
public function stop():void

Stop playing.

toggleMute()method 
public function toggleMute():void

Toggle mute.

unMute()method 
public function unMute():void

Un-mute.

unset()method 
public static function unset(id:String):void

Unset (delete) an audio object.

Parameters
id:String — The audio object id.
volumeTo()method 
public function volumeTo(level:Number, duration:Number = .3):void

Tween the volume.

Parameters
level:Number — The new volume level.
 
duration:Number (default = .3) — The time it takes to tween to the new level.
Event detail
completeevent 
Event object type: gs.support.soundmanager.AudioEvent

Dispatched when the sound has completed playing.

loopedevent  
Event object type: gs.support.soundmanager.AudioEvent

Dispatched when the sound has looped.

muteevent  
Event object type: gs.support.soundmanager.AudioEvent

Dispatched when the sound is muted.

panChangeevent  
Event object type: gs.support.soundmanager.AudioEvent

Dispatched when the panning changes.

pausedevent  
Event object type: gs.support.soundmanager.AudioEvent

Dispatched when the sound is paused.

progressevent  
Event object type: gs.support.soundmanager.AudioEvent

Dispatched for progress of the audio.

resumedevent  
Event object type: gs.support.soundmanager.AudioEvent

Dispatched when the sound is resumed.

startevent  
Event object type: gs.support.soundmanager.AudioEvent

Dispatched when the sound starts playing.

stopevent  
Event object type: gs.support.soundmanager.AudioEvent

Dispatched when the sound stops playing.

unmuteevent  
Event object type: gs.support.soundmanager.AudioEvent

Dispatched when the sound is un-muted.

volumeChangeevent  
Event object type: gs.support.soundmanager.AudioEvent

Dispatched when the volume changes