Packagesandy.core.scenegraph
Classpublic class Sound3D
InheritanceSound3D Inheritance ATransformable Inheritance Node

Transform audio volume and pan relative to the Camera3D



Public Properties
 PropertyDefined by
 Inheritedappearance : Appearance
Set that appearance to all the children of that node
Node
 InheritedboundingBox : BBox
The bounding box of this node IMPORTANT: Do not modify it unless you perfectly know what you are doing
Node
 InheritedboundingSphere : BSphere
The bounding sphere of this node IMPORTANT: Do not modify it unless you perfectly know what you are doing
Node
 Inheritedbroadcaster : BubbleEventBroadcaster
The broadcaster

The broadcaster is used to send events to listeners.
This property is a BubbleEventBroadcaster.

Node
 Inheritedchanged : Boolean = false
This property set the cache status of the current node.
Node
 Inheritedculled : CullingState
This property represent the culling state of the current node.
Node
  CULL_PLAY : String = "cullPlay"
[static]
Sound3D
  CULL_STOP : String = "cullStop"
[static]
Sound3D
  currentLoop : int
[read-only]
Sound3D
 Inheriteddisable : Boolean = false
Disable the local transformations applied to this Node if set to false.
ATransformable
 InheritedenableBackFaceCulling : Boolean
Change the backface culling state to all the shapes objects in the children list
Node
 InheritedenableEvents : Boolean
Enable event handling to all the children objects that can broadcast bubbling events
Node
 InheritedenableInteractivity : Boolean
Change the interactivity of all the children
Node
  flipPan : Boolean = true
If flipPan is true the left and right channels of the sound are mirrored if the camera is facing away from the sound
Sound3D
  isFlipped : Boolean
[read-only] Returns true if the stereo panorama is mirrored, flipPan have to be true to enable stereo flipping
Sound3D
  LOOP : String = "loop"
[static]
Sound3D
  loops : int = 0xffffff
Number of loops before the sound stops
Sound3D
  loopStartTime : Number = 0
Start time to play the audio from if the sound loops
Sound3D
 Inheritedmatrix : Matrix4
ATransformable
  maxPan : Number = 1
Maximal pan is a positive Number from 0-1 or higher
Sound3D
 Inheritedname : String
Name of this node.
Node
 Inheritedout : Vector
Forward direction ( local z ) in parent coordinates.
ATransformable
 Inheritedpan : Number
Pans this object around the local y axis.
ATransformable
 Inheritedparent : Node
The parent node of this node.
Node
 Inheritedroll : Number
Rolls this object around the local z axis.
ATransformable
 InheritedrotateX : Number
Rotates this object around an axis parallel to the parents x axis.
ATransformable
 InheritedrotateY : Number
Rotates this object around an axis parallel to the parents y axis.
ATransformable
 InheritedrotateZ : Number
Rotates this object around an axis paralell to the parents z axis.
ATransformable
 InheritedscaleX : Number
x scale of this object.
ATransformable
 InheritedscaleY : Number
y scale of this object.
ATransformable
 InheritedscaleZ : Number
z scale of this object.
ATransformable
 Inheritedscene : Scene3D = null
Reference to the scene is it linked to.
Node
 Inheritedside : Vector
Side direction ( local x ) in parent coordinates.
ATransformable
  soundChannel : SoundChannel
[read-only]
Sound3D
  soundMode : String
[read-only]
Sound3D
  soundPan : Boolean = true
If pan is true the panning of the sound is relative to the camera rotation
Sound3D
  soundRadius : Number
The radius of the sound
Sound3D
  soundSource : *
Set the sound source, the sound source can be a String, URLRequest, Sound or SoundChannel object
Sound3D
  soundVolume : Number
Max volume of the sound if camera position is at sound position
Sound3D
  startTime : Number = 0
The start time to play the audio from
Sound3D
  stereo : Boolean = false
If the sound contains two channels, stereo have to be set to true in order to mix left and right channels correctly
Sound3D
 Inheritedtarget : Vector
The position in the parent frame this object should "look at".
ATransformable
 Inheritedtilt : Number
Tilts this object around the local x axis.
ATransformable
  type : String = "speech"
Type is either SPEECH or NOISE, SPEECH will start the sound at the last position if the camera enters the sphere of the sound
Sound3D
 Inheritedup : Vector
Up direction ( local y ) in parent coordinates.
ATransformable
 InheriteduseSingleContainer : Boolean
Make all the Shape3D and descendants children react to this value.
Node
 Inheritedvisible : Boolean = true
Specify the visibility of this node.
Node
 Inheritedx : Number
x position of this object in its parent frame.
ATransformable
 Inheritedy : Number
y position of this object in its parent frame.
ATransformable
 Inheritedz : Number
z position of the node in its parent frame.
ATransformable
Protected Properties
 PropertyDefined by
 Inheritedm_oEB : BubbleEventBroadcaster
Node
 Inheritedm_oPreviousOffsetRotation : Vector
ATransformable
 Inheritedm_tmpMt : Matrix4
ATransformable
 Inherited_oScale : Vector
ATransformable
 Inherited_p : Vector
ATransformable
 Inherited_vOut : Vector
ATransformable
 Inherited_vSide : Vector
ATransformable
 Inherited_vUp : Vector
ATransformable
Public Methods
 MethodDefined by
  
Sound3D(p_sName:String = "", p_oSoundSource:* = null, p_nVolume:Number = 1, p_nMaxPan:Number = 0, p_nRadius:Number = 1, p_bStereo:Boolean = false)
Creates a 3D sound object wich can be placed in the 3d scene.
Sound3D
 Inherited
addChild(p_oChild:Node):void
Adds a new child to this node.
Node
 Inherited
addEventListener(p_sEvt:String, p_oL:*):void
Adds a listener for the specified event.
Node
  
cull(p_oScene:Scene3D, p_oFrustum:Frustum, p_oViewMatrix:Matrix4, p_bChanged:Boolean):void
Sound3D
 Inherited
destroy():void
Delete this node and all its child nodes.
Node
 Inherited
getChildByName(p_sName:String, p_bRecurs:Boolean = false):Node
Returns the child node with the specified name.
Node
 Inherited
getPosition(p_sMode:String = "local"):Vector
Returns the position of this group or object.
ATransformable
 Inherited
hasParent():Boolean
Tests if this node has a parent.
Node
 Inherited
initFrame():void
Initiates the local coordinate system for this object.
ATransformable
 Inherited
isParent(p_oNode:Node):Boolean
Tests if the node passed in the argument is parent of this node.
Node
 Inherited
lookAt(p_nX:Number, p_nY:Number, p_nZ:Number):void
Makes this object "look at" the specified position in the parent frame.
ATransformable
 Inherited
moveForward(p_nD:Number):void
Translates this object along its forward vector ( local z ) in the parent frame.
ATransformable
 Inherited
moveHorizontally(p_nD:Number):void
Translates this object parallel to its parent zx plane and in its forward direction.
ATransformable
 Inherited
moveLateraly(p_nD:Number):void
Translates this object laterally in its parent frame.
ATransformable
 Inherited
moveSideways(p_nD:Number):void
Translates this object along its side vector ( local x ) in the parent frame.
ATransformable
 Inherited
moveUpwards(p_nD:Number):void
Translates this object along its up vector ( local y ) in the parent frame.
ATransformable
 Inherited
moveVertically(p_nD:Number):void
Translates this object vertically in ots parent frame.
ATransformable
 Inherited
perform(p_iOperation:INodeOperation):void
Performs an operation on this node and all of its children.
Node
  
play(p_nStartTime:Number = -1, p_iLoops:int = -1, p_nLoopStartTime:Number = -1, p_bResume:Boolean = false):void
Start Sound sources of type Sound or UrlRequest.
Sound3D
 Inherited
remove():void
Removes this node from the node tree, saving its child nodes.
Node
 Inherited
removeChildByName(p_sName:String):Boolean
Removes the child node with the specified name.
Node
 Inherited
removeEventListener(p_sEvt:String, p_oL:*):void
Removes a listener for the specified event.
Node
 Inherited
render(p_oScene:Scene3D, p_oCamera:Camera3D):void
Renders this node.
Node
 Inherited
rotateAxis(p_nX:Number, p_nY:Number, p_nZ:Number, p_nAngle:Number):void
Rotate this object around the specified axis in the parent frame by the specified angle.
ATransformable
 Inherited
setPosition(p_nX:Number, p_nY:Number, p_nZ:Number):void
Sets the position of this object in coordinates of its parent frame.
ATransformable
  
stop():void
Stop the sound source and SoundChannel
Sound3D
 Inherited
swapParent(p_oNewParent:Node):void
Moves this node to another parent node.
Node
  
toString():String
Sound3D
 Inherited
translate(p_nX:Number, p_nY:Number, p_nZ:Number):void
Translate this object from it's current position with the specified offsets.
ATransformable
 Inherited
update(p_oScene:Scene3D, p_oModelMatrix:Matrix4, p_bChanged:Boolean):void
Updates this node or object.
ATransformable
 Inherited
Updates the transform matrix of the current object/node before it is rendered.
ATransformable
Public Constants
 ConstantDefined by
 Inheritedchildren : Array
The children of this node are stored inside this array.
Node
 Inheritedid : uint
The unique id of this node in the node graph.
Node
 InheritedmodelMatrix : Matrix4
Cached matrix corresponding to the transformation to the 0,0,0 frame system
Node
  NOISE : String = "noise"
[static]
Sound3D
  SPEECH : String = "speech"
[static]
Sound3D
 InheritedviewMatrix : Matrix4
Cached matrix corresponding to the transformation to the camera frame system
Node
Property detail
CULL_PLAYproperty
public static var CULL_PLAY:String = "cullPlay"
CULL_STOPproperty 
public static var CULL_STOP:String = "cullStop"
currentLoopproperty 
currentLoop:int  [read-only]Implementation
    public function get currentLoop():int
flipPanproperty 
public var flipPan:Boolean = true

If flipPan is true the left and right channels of the sound are mirrored if the camera is facing away from the sound

isFlippedproperty 
isFlipped:Boolean  [read-only]

Returns true if the stereo panorama is mirrored, flipPan have to be true to enable stereo flipping

Implementation
    public function get isFlipped():Boolean
LOOPproperty 
public static var LOOP:String = "loop"
loopsproperty 
public var loops:int = 0xffffff

Number of loops before the sound stops

loopStartTimeproperty 
public var loopStartTime:Number = 0

Start time to play the audio from if the sound loops

maxPanproperty 
public var maxPan:Number = 1

Maximal pan is a positive Number from 0-1 or higher

soundChannelproperty 
soundChannel:SoundChannel  [read-only]Implementation
    public function get soundChannel():SoundChannel
soundModeproperty 
soundMode:String  [read-only]Implementation
    public function get soundMode():String
soundPanproperty 
public var soundPan:Boolean = true

If pan is true the panning of the sound is relative to the camera rotation

soundRadiusproperty 
public var soundRadius:Number

The radius of the sound

soundSourceproperty 
soundSource:*  [read-write]

Set the sound source, the sound source can be a String, URLRequest, Sound or SoundChannel object

Implementation
    public function get soundSource():*
    public function set soundSource(value:*):void
soundVolumeproperty 
public var soundVolume:Number

Max volume of the sound if camera position is at sound position

startTimeproperty 
public var startTime:Number = 0

The start time to play the audio from

stereoproperty 
public var stereo:Boolean = false

If the sound contains two channels, stereo have to be set to true in order to mix left and right channels correctly

typeproperty 
public var type:String = "speech"

Type is either SPEECH or NOISE, SPEECH will start the sound at the last position if the camera enters the sphere of the sound

Constructor detail
Sound3D()constructor
public function Sound3D(p_sName:String = "", p_oSoundSource:* = null, p_nVolume:Number = 1, p_nMaxPan:Number = 0, p_nRadius:Number = 1, p_bStereo:Boolean = false)

Creates a 3D sound object wich can be placed in the 3d scene. Set stereo to true if the sound source is in stereo. If stereo is true, both channels are at the same position in 3d space, but the stereo panorama is kept and mirrored if required. To create a true stereo effect, take two Sound3D instances and two mono sound sources on different locations in 3d space.

Parameters
p_sName:String (default = "") — p_sName A string identifier for this object
 
p_oSoundSource:* (default = null) — The sound source, a String, UrlRequest, Sound or a SoundChannel object
 
p_nVolume:Number (default = 1) — Volume of the sound
 
p_nMaxPan:Number (default = 0) — Max pan of the sound, if zero panning is disabled
 
p_nRadius:Number (default = 1) — Radius of the sound in 3d units
 
p_bStereo:Boolean (default = false) — If the sound contains two different channels
Method detail
cull()method
public override function cull(p_oScene:Scene3D, p_oFrustum:Frustum, p_oViewMatrix:Matrix4, p_bChanged:Boolean):voidParameters
p_oScene:Scene3D
 
p_oFrustum:Frustum
 
p_oViewMatrix:Matrix4
 
p_bChanged:Boolean
play()method 
public function play(p_nStartTime:Number = -1, p_iLoops:int = -1, p_nLoopStartTime:Number = -1, p_bResume:Boolean = false):void

Start Sound sources of type Sound or UrlRequest. Sound sources of type SoundChannel don't support the play method

Parameters
p_nStartTime:Number (default = -1)
 
p_iLoops:int (default = -1)
 
p_nLoopStartTime:Number (default = -1)
 
p_bResume:Boolean (default = false)
stop()method 
public function stop():void

Stop the sound source and SoundChannel

toString()method 
public override function toString():String

Returns
String
Constant detail
NOISEconstant
public static const NOISE:String = "noise"
SPEECHconstant 
public static const SPEECH:String = "speech"