Packagecom.gestureworks.cml.element
Classpublic class WAV
InheritanceWAV Inheritance ElementFactory Inheritance flash.display.Sprite

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
 Inheritedalpha : Number
[override] [write-only] sets the alpha for display objects
ElementFactory
  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
  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
 Inheritedblur : Boolean
Sets the drop shadow effect
ElementFactory
 Inheritedbottom : Number
sets the bottom value
ElementFactory
  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
 Inheritedclass_ : String
Object's css class;
ElementFactory
 InheritedclassName : String
sets the class name of displayobject
ElementFactory
 InheritedcmlIndex : int
sets the cml index
ElementFactory
  comment : String
[read-only]
WAV
  cueStart : Number
Cue start point in milliseconds
WAV
  date : String
[read-only]
WAV
 InheriteddebugStyle : *
sets the debug style
ElementFactory
  display : String
Visualization display type, choose waveform or none
WAV
 InheriteddisplayEvents : String
Use for dispatch completes.
ElementFactory
 InheriteddropShadow : Boolean
Sets the drop shadow effect
ElementFactory
  duration : Number
[read-only] Total duration
WAV
  fileSize : uint
[read-only]
WAV
 Inheritedheight : Number
[override] Sets width of the display object in pixels
ElementFactory
 InheritedheightPercent : String
sets the height percent of display object
ElementFactory
 InheritedhorizontalCenter : Number
sets the horizontal center of display object
ElementFactory
 Inheritedid : String
sets the id of child
ElementFactory
 Inheritedindex : int
sets the index of display object
ElementFactory
  isPlaying : Boolean
[read-only] Sets video playing status
WAV
 Inheritedleft : Number
sets left value
ElementFactory
  length : uint
[read-only] length of wav file
WAV
  loop : Boolean
Specifies wether the wav file will to loop to the beginning and continue playing upon completion
WAV
  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
  position : Number
[read-only] Playhead position in ms
WAV
  preload : Boolean
Indicates whether the wav file is preloaded by the cml parser
WAV
  printData : Boolean
print data
WAV
 InheritedpropertyStates : Array
Deprecated: Please Use state
ElementFactory
  publisher : String
[read-only]
WAV
 Inheritedright : Number
sets the right value
ElementFactory
  sampleRate : uint
[read-only]
WAV
 Inheritedscale : Number
Sets both the x and y scale values
ElementFactory
 InheritedscaleX : Number
[override] Sets width of the display object in pixels
ElementFactory
 InheritedscaleY : Number
[override] Sets width of the display object in pixels
ElementFactory
  src : String
Sets the wav file path
WAV
 Inheritedstate : Array
property states array
ElementFactory
  TIME : String = Time
[static]
WAV
  timer : Timer
WAV
  title : String
[read-only]
WAV
 Inheritedtop : Number
sets top value
ElementFactory
 InheritedverticalCenter : Number
sets the vertical center of display object
ElementFactory
  volume : Number
Sets the volume
WAV
  waveColor : uint
Sets the color of the waveform
WAV
 Inheritedwidth : Number
[override] Sets width of the display object in pixels
ElementFactory
 InheritedwidthPercent : String
sets the percent of width of display object
ElementFactory
  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
  _msByteRate : uint = 0
Byte rate in milliseconds default = 0
WAV
  _stream : FileStream
WAV
Public Methods
 MethodDefined By
  
WAV()
Constructor
WAV
 Inherited
clone():*
Returns clone of self
ElementFactory
  
close():void
closes wav file
WAV
  
[override] CML callback Initialisation
WAV
  
dispose():void
[override] Dispose methods and nullify attributes
WAV
  
init():void
[override] Initialisation method
WAV
  
open(file:String):void
Sets the src property from the argument and loads the wav file
WAV
 Inherited
parseCML(cml:XMLList):XMLList
parses cml file
ElementFactory
  
pause():void
pauses the wav file
WAV
  
play():void
plays wav file
WAV
 Inherited
postparseCML(cml:XMLList):void
post parses the cml file
ElementFactory
  
seek(pos:Number):void
seek method
WAV
  
stop():void
stops wav file
WAV
 Inherited
updateProperties(state:Number = 0):void
this method updates the properties
ElementFactory
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
lengthproperty 
length:uint  [read-only]

length of wav file


Implementation
    public function get length():uint
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
positionproperty 
position:Number  [read-only]

Playhead position in ms

The default value is 0.


Implementation
    public function get position():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
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

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

CML callback Initialisation

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

Dispose methods and nullify attributes

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