SeiON: Actionscript 3 Sound Engine | All Packages | All Classes | Index | Frames No Frames |
SeionClip

Package | com.SeiON
Class | public final class SeionClip
Inheritance | SeionClip SeionInstance Object

The simplest way to play a sound.

SeionClip is a simple wrapper over both the native Sound and the _sndChannel object in Flash. Use SeionClip.create() to instantiate this class.

See also

create()

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | autodispose : Boolean [read-only] Whether this sound is auto-disposable. | SeionInstance
|  | isPaused : Boolean [override] [read-only] Is the playback paused? (ISeionControl) | SeionClip
|  | isPlaying : Boolean [override] [read-only] Is the sound active? (ISeionInstance) | SeionClip
|  | length : Number [override] [read-only] The total length of the clip, excluding repeats. | SeionClip
|  | manager : SeionGroup [read-only] Returns the manager that holds this ISeionInstance. | SeionInstance
|  | name : String The name of the clip, non-unique. | SeionInstance
|  | offset : uint [read-only] The delayed starting position. | SeionClip
|  | pan : Number Get: The panning as affected by its parent. | SeionInstance
|  | position : Number [override] [read-only] How far into the clip we are. | SeionClip
|  | progress : Number [override] [read-only] How far into the clip we are, from 0.0 - 1.0. | SeionClip
|  | repeat : int How many times the SeionInstance is programmed to repeat itself. | SeionInstance
|  | repeatLeft : int [read-only] How many more times the SeionInstance has to repeat itself. | SeionInstance
|  | soundtransform : SoundTransform [read-only] Returns the predefined sound properties of the sound. | SeionInstance
|  | truncate : uint [read-only] The truncation from the ending position. | SeionClip
|  | volume : Number Get: The volume as affected by its parent. | SeionInstance

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | SeionClip(secretKey:*) Please do not call this constructor directly; it will throw an error. | SeionClip
|  | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void | SeionInstance
|  | create(name:String, manager:SeionGroup, snd:Sound, repeat:int, autodispose:Boolean = true, sndTransform:SoundTransform = null):SeionClip [static] Creates a sound clip. | SeionClip
|  | createExcerpt(name:String, manager:SeionGroup, snd:Sound, repeat:int, autodispose:Boolean, sndTransform:SoundTransform, offset:uint, truncate:uint):SeionClip [static] Creates a sound clip that can be shortened. | SeionClip
|  | dispatchEvent(event:Event):Boolean | SeionInstance
|  | dispose():void [override] Clears all references held. | SeionClip
|  | hasEventListener(type:String):Boolean | SeionInstance
|  | isDisposed(output:Boolean = true):Boolean Is the SeionInstance already disposed of? (ISeionInstance) | SeionInstance
|  | pause():void [override] Pauses playback of sound. | SeionClip
|  | play():void [override] Plays the sound from the beginning again. | SeionClip
|  | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void | SeionInstance
|  | resume():void [override] Resumes playback of sound. | SeionClip
|  | stop():void [override] Stops the sound and resets it to Zero. | SeionClip
|  | willTrigger(type:String):Boolean | SeionInstance

Events
Hide Inherited Events
Show Inherited Events

| Event | Summary | Defined By
--- | --- | --- | ---
|  | soundComplete | Defines the value when a SeionInstance finishes playback and does not repeat. | SeionInstance
|  | soundRepeat | Defines the value when a SeionInstance loops itself. | SeionInstance

Property Detail

isPaused | property

`isPaused:Boolean` [read-only] [override]

Is the playback paused? (ISeionControl)

Implementation
`public function get isPaused():Boolean`

isPlaying | property |

`isPlaying:Boolean` [read-only] [override]

Is the sound active? (ISeionInstance)

Implementation
`public function get isPlaying():Boolean`

length | property |

`length:Number` [read-only] [override]

The total length of the clip, excluding repeats. In Milliseconds. (ISeionInstance)

Implementation
`public function get length():Number`

offset | property |

`offset:uint` [read-only]

The delayed starting position. In Milliseconds.

Implementation
`public function get offset():uint`

position | property |

`position:Number` [read-only] [override]

How far into the clip we are. In Milliseconds. (ISeionInstance)

Includes offsets or truncated durations, eg. a 10 second _snd with 5 seconds offset at starting position would report a position of 0, not 5.
Implementation
`public function get position():Number`

progress | property |

`progress:Number` [read-only] [override]

How far into the clip we are, from 0.0 - 1.0. (ISeionInstance)

Includes offsets or truncations, eg. a 100 second _snd with 5 seconds offset at starting position would report a position of 0.0, not 0.95.
Implementation
`public function get progress():Number`

truncate | property |

`truncate:uint` [read-only]

The truncation from the ending position. In Milliseconds.

Implementation
`public function get truncate():uint`
Constructor Detail

SeionClip | () | Constructor

`public function SeionClip(secretKey:*)`

Please do not call this constructor directly; it will throw an error. Call it through SeionClip.create().

Parameters

| `secretKey:*`

See also

SeionClip.create()
Method Detail

create | () | method

`public static function create(name:String, manager:SeionGroup, snd:Sound, repeat:int, autodispose:Boolean = true, sndTransform:SoundTransform = null):SeionClip`

Creates a sound clip.

Parameters

| `name:String` — Any name, even a non-unique one.
| `manager:SeionGroup` — The SeionGroup that manages this SeionClip. Immutable.
| `snd:Sound` — The sound data. Immutable.
| `repeat:int` — How many times to repeat the clip.
| `autodispose:Boolean` (default = `true`)`` — Whether the clip will auto-mark for GC. Immutable.
| `sndTransform:SoundTransform` (default = `null`)`` — The fixed internal property for the sound.

Returns

| `SeionClip` — A SeionClip is allocation was successful. Null if allocation failed, or autodispose is true.

See also

SeionInstance.name
SeionInstance.repeat
SeionInstance.soundtransform
SeionInstance.autodispose

createExcerpt | () | method |

`public static function createExcerpt(name:String, manager:SeionGroup, snd:Sound, repeat:int, autodispose:Boolean, sndTransform:SoundTransform, offset:uint, truncate:uint):SeionClip`

Creates a sound clip that can be shortened.

Parameters

| `name:String` — Any name, even a non-unique one.
| `manager:SeionGroup` — The SeionGroup that manages this SeionClip. Immutable.
| `snd:Sound` — The sound data. Immutable.
| `repeat:int` — How many times to repeat the clip.
| `autodispose:Boolean` — Whether the clip will auto-mark for GC. Immutable.
| `sndTransform:SoundTransform` — The fixed internal property for the sound.
| `offset:uint` — The delayed starting position. In Milliseconds. Immutable.
| `truncate:uint` — The truncation from the ending position. In Milliseconds. Immutable.

Returns

| `SeionClip` — A SeionClip if allocation was successful. Null if allocation failed, or autodispose is true.

See also

SeionInstance.name
SeionInstance.repeat
SeionInstance.soundtransform
SeionInstance.autodispose
offset
truncate

dispose | () | method |

`override public function dispose():void`

Clears all references held. This object is now invalid. (ISeionInstance)

pause | () | method |

`override public function pause():void`

Pauses playback of sound. (ISeionControl)

play | () | method |

`override public function play():void`

Plays the sound from the beginning again. (ISeionInstance)

resume | () | method |

`override public function resume():void`

Resumes playback of sound. (ISeionControl)

stop | () | method |

`override public function stop():void`

Stops the sound and resets it to Zero. (ISeionInstance)

Tue Jun 21 2011, 10:05 PM +08:00