Packagecom.gestureworks.cml.elements
Classpublic class WAV
InheritanceWAV Inheritance TouchContainer Inheritance com.gestureworks.core.TouchSprite

The WAV element is an AIR required element that loads in a .WAV file and plays it, with the options to pause, stop, and resume play. The WAV element will automatically load any XMP data if it is present. The WAV element also provides the option of a graphical waveform by setting the display property to "waveform", otherwise "none". The waveform's color can be set.

To use the WavElement, it absolutely MUST be compiled in an AIR project.

     
       var wavElement:WavElement = new WavElement();
        wavElement.open("FDR-Infamy.wav");
        wavElement.autoplay = true;
        wavElement.display = "waveform";
        wavElement.volume = 0.5;
        addChild(wavElement);    
        wavElement.init();        
        
     
     



Public Properties
 PropertyDefined By
  album : String
[read-only]
WAV
  artist : String
[read-only]
WAV
  autoLoad : Boolean
Deprecated: Please Use preload
Indicates whether the wav file is autoloaded
WAV
  autoplay : Boolean
Indicates whether the wav file plays upon load
WAV
 InheritedautoShuffle : Boolean
autoshuffles
TouchContainer
  averageGain : Array
[read-only]
WAV
  backgroundAlpha : Number
Sets the background alpha
WAV
  backgroundColor : uint
Sets the background color
WAV
  bitDepth : uint
[read-only] depth of wav file
WAV
  blockAlign : uint
[read-only]
WAV
  bufferSize : uint
Audio buffer size
WAV
  byteRate : uint
[read-only] Audio byte rate (bytes per second)
WAV
  channels : uint
[read-only] Number of audio channels
WAV
 InheritedchildList : ChildList
Returns the object's childList.
TouchContainer
 InheritedclassName : String
sets the class name of displayobject
TouchContainer
 InheritedcloneExclusions : Vector.<String>
[read-only] Returns a list of properties to exclude when cloning this object
TouchContainer
 InheritedcmlIndex : int
Returns the index created by the CML parser.
TouchContainer
  comment : String
[read-only]
WAV
  cueStart : Number
Cue start point in milliseconds
WAV
  date : String
[read-only]
WAV
 InheriteddimensionsTo : Object
Sets the dimensions of TouchContainer to given object
TouchContainer
  display : String
Visualization display type, choose waveform or none
WAV
 InheriteddropShadow : Boolean
Sets the drop shadow effect
TouchContainer
  duration : Number
[read-only] Total duration
WAV
  fileSize : uint
[read-only]
WAV
 Inheritedgroup : String
TouchContainer
 Inheritedheight : Number
[override] sets the height of the container
TouchContainer
 InheritedheightPercent : Number
sets the height of the container
TouchContainer
 Inheritedid : String
Returns the object's id.
TouchContainer
  isPlaying : Boolean
[read-only] Sets video playing status
WAV
 Inheritedlayout : *
specifies the type of layout
TouchContainer
 InheritedlayoutList : Dictionary
TouchContainer
  loop : Boolean
Specifies wether the wav file will to loop to the beginning and continue playing upon completion
WAV
 InheritedmouseChildren : Boolean
[override] sets the mousechildren value to true or false.
TouchContainer
 InheritedpaddingBottom : Number
Sets the number of pixels between the container's bottom border and the bottom of its content area.
TouchContainer
 InheritedpaddingLeft : Number
Sets the number of pixels between the component's left border and the left edge of its content area.
TouchContainer
 InheritedpaddingRight : Number
Sets the number of pixels between the component's right border and the right edge of its content area.
TouchContainer
 InheritedpaddingTop : Number
Sets the number of pixels between the container's top border and the top of its content area.
TouchContainer
  pan : Number
Sets the audio pannning ( -1 = left, 0 = center, 1 = right )
WAV
  paused : Boolean
[read-only] specifies whether the wav file is paused or not
WAV
  percentLoaded : Number
[read-only] Percent of file loaded
WAV
  playhead : Number
[read-only] Playhead position in ms
WAV
 Inheritedposition : *
Sets the position
TouchContainer
  preload : Boolean
Indicates whether the wav file is preloaded by the cml parser
WAV
  printData : Boolean
print data
WAV
  publisher : String
[read-only]
WAV
 InheritedrelativeX : Boolean
When set true this containers children's x position will be laid out relatively to each other.
TouchContainer
 InheritedrelativeY : Boolean
When set true this containers children's y position will be laid out relatively to each other.
TouchContainer
  sampleRate : uint
[read-only]
WAV
 Inheritedsound : String
TouchContainer
  src : String
Sets the wav file path
WAV
 Inheritedstate : Dictionary
TouchContainer
 InheritedstateId : *
Returns the current state id.
TouchContainer
  TIME : String = Time
[static]
WAV
  timer : Timer
WAV
  title : String
[read-only]
WAV
 InheritedtoBitmap : Boolean
TouchContainer
  volume : Number
Sets the volume
WAV
  waveColor : uint
Sets the color of the waveform
WAV
  wavLength : uint
[read-only] length of wav file
WAV
 Inheritedwidth : Number
[override] sets the width of the container
TouchContainer
 InheritedwidthPercent : Number
sets the width of the container
TouchContainer
  xmp : XMPMeta
[read-only]
WAV
Protected Properties
 PropertyDefined By
  _audioStreamAvailable : Number = 0
Number of audio data bytes available in file stream
WAV
  _audioStreamEnd : Number = 0
Byte position in file stream which indicates the beginning of audio data default = 0
WAV
  _audioStreamPosition : Number = 0
Current audio data byte position in the file stream
WAV
  _audioStreamSize : Number = 0
Total size in bytes of audio data in file stream default = 0
WAV
  _audioStreamStart : Number = 0
Byte position in file stream which indicates the beginning of audio data
WAV
 InheritedcmlGestureList : Object
TouchContainer
  _msByteRate : uint = 0
Byte rate in milliseconds default = 0
WAV
  _stream : FileStream
WAV
Public Methods
 MethodDefined By
  
WAV()
Constructor
WAV
 Inherited
TouchContainer
 Inherited
method searches the child and adds to the list
TouchContainer
 Inherited
addChild(child:DisplayObject):DisplayObject
[override] Adds child to display list and, if not already added, the child list
TouchContainer
 Inherited
addChildAt(child:DisplayObject, index:int):DisplayObject
[override] Adds child to display list and, if not already added, the child list
TouchContainer
 Inherited
applyLayout(value:* = null):void
Apply the containers layout
TouchContainer
 Inherited
childToList(id:String, child:*):void
child appended to the childlist
TouchContainer
 Inherited
clone():*
Clone method
TouchContainer
  
close():void
closes wav file
WAV
  
dispose():void
[override] Destructor
WAV
 Inherited
getElementById(id:String):*
Searches CML childList by id.
TouchContainer
 Inherited
getElementsByClassName(className:String):Array
Searches the CML childList by className.
TouchContainer
 Inherited
getElementsByTagName(tagName:Class):Array
Searches the CML childList by tagName as Class.
TouchContainer
  
init():void
[override] Initialisation method
WAV
 Inherited
loadState(sId:* = null, recursion:Boolean = false):void
Loads state by index number.
TouchContainer
 Inherited
makeGestureList(value:XMLList):Object
Creates gestureList object from XML
TouchContainer
  
open(file:String):void
Sets the src property from the argument and loads the wav file
WAV
 Inherited
parseCML(cml:XMLList):XMLList
Parse cml for local layouts.
TouchContainer
  
pause():void
pauses the wav file
WAV
  
play():void
plays wav file
WAV
 Inherited
postparseCML(cml:XMLList):void
Abstract method allows the setting of a postparse CML routine.
TouchContainer
 Inherited
querySelector(selector:String):*
Searches the CML childList by selector.
TouchContainer
 Inherited
querySelectorAll(selector:*):Array
Search the CML childList by selector.
TouchContainer
 Inherited
removeChild(child:DisplayObject):DisplayObject
[override] Removes child from display list and, if not already removed, the child list
TouchContainer
 Inherited
removeChildAt(index:int):DisplayObject
[override] Removes child from display list and, if not already removed, the child list
TouchContainer
 Inherited
removeChildren(beginIndex:int = 0, endIndex:int = 2147483647):void
[override] Removes children from display list and, if not already removed, the child list
TouchContainer
 Inherited
saveState(sId:* = null, recursion:Boolean = false):void
Save state by index number.
TouchContainer
 Inherited
searchChildren(value:*, returnType:Class = null):*
This method does a depth first search of childLists.
TouchContainer
  
seek(pos:Number):void
seek method
WAV
 Inherited
method sets the dimensions of each child
TouchContainer
  
stop():void
stops wav file
WAV
 Inherited
tweenState(sId:* = null, tweenTime:Number = 1):void
Tween state by stateIndex from current to given state index.
TouchContainer
 Inherited
Updates child padding within this container
TouchContainer
 Inherited
Updates child percent dimensions within this container
TouchContainer
 Inherited
updateProperties(state:* = 0):void
Updates properties from state.
TouchContainer
 Inherited
Updates child relative positions within this container
TouchContainer
Property Detail
_audioStreamAvailableproperty
protected var _audioStreamAvailable:Number = 0

Number of audio data bytes available in file stream

The default value is 0.

_audioStreamEndproperty 
protected var _audioStreamEnd:Number = 0

Byte position in file stream which indicates the beginning of audio data default = 0

_audioStreamPositionproperty 
protected var _audioStreamPosition:Number = 0

Current audio data byte position in the file stream

The default value is 0.

_audioStreamSizeproperty 
protected var _audioStreamSize:Number = 0

Total size in bytes of audio data in file stream default = 0

_audioStreamStartproperty 
protected var _audioStreamStart:Number = 0

Byte position in file stream which indicates the beginning of audio data

The default value is 0.

_msByteRateproperty 
protected var _msByteRate:uint = 0

Byte rate in milliseconds default = 0

_streamproperty 
protected var _stream:FileStream

albumproperty 
album:String  [read-only]


Implementation
    public function get album():String
artistproperty 
artist:String  [read-only]


Implementation
    public function get artist():String
autoLoadproperty 
autoLoad:Boolean
Deprecated: Please Use preload

Indicates whether the wav file is autoloaded


Implementation
    public function get autoLoad():Boolean
    public function set autoLoad(value:Boolean):void
autoplayproperty 
autoplay:Boolean

Indicates whether the wav file plays upon load

The default value is true.


Implementation
    public function get autoplay():Boolean
    public function set autoplay(value:Boolean):void
averageGainproperty 
averageGain:Array  [read-only]


Implementation
    public function get averageGain():Array
backgroundAlphaproperty 
backgroundAlpha:Number

Sets the background alpha

The default value is 1.0.


Implementation
    public function get backgroundAlpha():Number
    public function set backgroundAlpha(value:Number):void
backgroundColorproperty 
backgroundColor:uint

Sets the background color

The default value is 0x333333.


Implementation
    public function get backgroundColor():uint
    public function set backgroundColor(value:uint):void
bitDepthproperty 
bitDepth:uint  [read-only]

depth of wav file


Implementation
    public function get bitDepth():uint
blockAlignproperty 
blockAlign:uint  [read-only]


Implementation
    public function get blockAlign():uint
bufferSizeproperty 
bufferSize:uint

Audio buffer size

The default value is 2048.


Implementation
    public function get bufferSize():uint
    public function set bufferSize(value:uint):void
byteRateproperty 
byteRate:uint  [read-only]

Audio byte rate (bytes per second)

The default value is 0.


Implementation
    public function get byteRate():uint
channelsproperty 
channels:uint  [read-only]

Number of audio channels

The default value is 0.


Implementation
    public function get channels():uint
commentproperty 
comment:String  [read-only]


Implementation
    public function get comment():String
cueStartproperty 
cueStart:Number

Cue start point in milliseconds

The default value is 0.


Implementation
    public function get cueStart():Number
    public function set cueStart(value:Number):void
dateproperty 
date:String  [read-only]


Implementation
    public function get date():String
displayproperty 
display:String

Visualization display type, choose waveform or none

The default value is waveform.


Implementation
    public function get display():String
    public function set display(value:String):void
durationproperty 
duration:Number  [read-only]

Total duration

The default value is 0.


Implementation
    public function get duration():Number
fileSizeproperty 
fileSize:uint  [read-only]


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

Sets video playing status

The default value is false.


Implementation
    public function get isPlaying():Boolean
loopproperty 
loop:Boolean

Specifies wether the wav file will to loop to the beginning and continue playing upon completion

The default value is false.


Implementation
    public function get loop():Boolean
    public function set loop(value:Boolean):void
panproperty 
pan:Number

Sets the audio pannning ( -1 = left, 0 = center, 1 = right )

The default value is 0.


Implementation
    public function get pan():Number
    public function set pan(value:Number):void
pausedproperty 
paused:Boolean  [read-only]

specifies whether the wav file is paused or not

The default value is false.


Implementation
    public function get paused():Boolean
percentLoadedproperty 
percentLoaded:Number  [read-only]

Percent of file loaded

The default value is 0.


Implementation
    public function get percentLoaded():Number
playheadproperty 
playhead:Number  [read-only]

Playhead position in ms

The default value is 0.


Implementation
    public function get playhead():Number
preloadproperty 
preload:Boolean

Indicates whether the wav file is preloaded by the cml parser

The default value is true.


Implementation
    public function get preload():Boolean
    public function set preload(value:Boolean):void
printDataproperty 
printData:Boolean

print data


Implementation
    public function get printData():Boolean
    public function set printData(value:Boolean):void
publisherproperty 
publisher:String  [read-only]


Implementation
    public function get publisher():String
sampleRateproperty 
sampleRate:uint  [read-only]


Implementation
    public function get sampleRate():uint
srcproperty 
src:String

Sets the wav file path

The default value is .


Implementation
    public function get src():String
    public function set src(value:String):void
TIMEproperty 
public static var TIME:String = Time

timerproperty 
public var timer:Timer

titleproperty 
title:String  [read-only]


Implementation
    public function get title():String
volumeproperty 
volume:Number

Sets the volume

The default value is 1.


Implementation
    public function get volume():Number
    public function set volume(value:Number):void
waveColorproperty 
waveColor:uint

Sets the color of the waveform

The default value is 0xFFFFFF.


Implementation
    public function get waveColor():uint
    public function set waveColor(value:uint):void
wavLengthproperty 
wavLength:uint  [read-only]

length of wav file


Implementation
    public function get wavLength():uint
xmpproperty 
xmp:XMPMeta  [read-only]


Implementation
    public function get xmp():XMPMeta
Constructor Detail
WAV()Constructor
public function WAV()

Constructor

Method Detail
close()method
public function close():void

closes wav file

dispose()method 
override public function dispose():void

Destructor

init()method 
override public function init():void

Initialisation method

open()method 
public function open(file:String):void

Sets the src property from the argument and loads the wav file

Parameters

file:String — Full path and file name of wav file

pause()method 
public function pause():void

pauses the wav file

play()method 
public function play():void

plays wav file

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

seek method

Parameters

pos:Number

stop()method 
public function stop():void

stops wav file