Class Index | File Index

Classes


Class VENISON.AUDIO.AudioManager

Singleton used for playing sounds.
Defined in: venison_engine.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
Everything is heard normally within this distance from the point of interest.
 
No sound is heard outside of this distance.
 
The point from which all dynamic sounds should be heard.
Method Summary
Method Attributes Method Name and Description
 
fnLoadSound(iSoundName, iFilePath)
Load sound from path excluding file suffix.
 
fnPlaySound(iSoundName, iPosition, iShouldRepeat)
Plays a sound.
 
Mute all sounds.
 
Stops a repeating sound.
Class Detail
VENISON.AUDIO.AudioManager()
Field Detail
{Number} innerCircleRadius
Everything is heard normally within this distance from the point of interest.
Default Value:
50

{Number} outerCircleRadius
No sound is heard outside of this distance. In the space between this distance and innerCircleRadius, volume is lowered.
Default Value:
150

{VENISON.UTILITIES.Vector2} pointOfInterest
The point from which all dynamic sounds should be heard. NOTE: Since this is a reference to a vector, the point of interest will update along with the referred one.
Method Detail
{Boolean} fnLoadSound(iSoundName, iFilePath)
Load sound from path excluding file suffix. fnLoadSound will try to load the sound in a format that is compatible with the current browser.
Parameters:
iSoundName
The name the sound will be known by in the AudioManager.
iFilePath
The relative path to the file including the file name without the suffix, e.g 'audioFolder/testAudioFile'.
Returns:
{Boolean} false if browser does not support ogg, mp3 or wav. If support was detected, return true and try to load the file.

fnPlaySound(iSoundName, iPosition, iShouldRepeat)
Plays a sound. If parameter iPosition is supplied, the sound will be a dynamic sound. If parameter iShouldRepeat is supplied, the sound will be a repeating sound.
Parameters:
{String} iSoundName
The name of the sound.
{VENISON.UTILITIES.Vector2} iPosition
Reference to a position.
{Boolean} iShouldRepeat
true if sound should loop.
Returns:
An index is returned for repeating sounds, which can be used to stop the sound at a later time.

fnSetGlobalMute(iMuted)
Mute all sounds.
Parameters:
{Boolean} iMuted
true if sounds should be muted, false if not.

fnStopRepeatingSound(iIndex)
Stops a repeating sound.
Parameters:
{Number} iIndex
The index that is used to identify the repeating sound in the VENISON.AUDIO.AudioManager.

Documentation generated by JsDoc Toolkit 2.4.0 on Thu May 05 2011 18:47:28 GMT+0200 (CEST)