class Sound3D
package away3d.audio
extends ObjectContainer3D › Object3D › NamedAssetBase
Available on all platforms
A sound source/emitter object that can be positioned in 3D space, and from which all audio playback will be transformed to simulate orientation.
The Sound3D object works much in the same fashion as primitives, lights and cameras, in that it can be added to a scene and positioned therein. It is the main object, in the 3D sound API, which the programmer will interact with.
Actual sound transformation is performed by a driver object, which is defined at the time of creation by the driver ini variable, the default being a simple pan/volume driver.
See also:
SimplePanVolumeDriver
Constructor
new(sound:Sound, reference:ObjectContainer3D, ?driver:ISound3DDriver, volume:Float = 1, scale:Float = 1000)
Create a Sound3D object, representing the sound source used for playback of a flash Sound object.
Parameters:
sound | The flash Sound object that is played back from this Sound3D object's position. For realistic results, this should be a mono (single-channel, non-stereo) sound stream. |
|---|---|
reference | The reference, or "listener" object, typically a camera. |
driver | Sound3D driver to use when applying simulation effects. Defaults to SimplePanVolumeDriver. |
init | [optional] An initialisation object for specifying default instance properties. |
Variables
Methods
stop():Void
Stop and rewind sound file. Replay (from the beginning) using play(). To temporarily pause playback, allowing you to resume from the same point, use pause() instead.
See also:
pause()
togglePlayPause():Void
Alternate between pausing and resuming playback of this sound. If called while sound is paused (or stopped), this will resume playback. When called during playback, it will pause it.