Core Docs | Additional Modules Docs
@Description: A constructor for creating new sound object instances. Allows javascript to load, play and stop mp3 sounds.
@File: sound.js
@Author: Paul Visco
@Example:var yellow = new sb.sound(
url : 'yellow.mp3',
debug : true,
onID3 : function(){},
onProgress : function(){}
);
yellow.play();
@Description: Mutes all sounds playing on the page
@File: sound.js
@Example:sb.sound.muteAll();
//or
sb.sound.muteAll('yellow.mp3');
@Description: When set to 1, sounds will not play
@File: sound.js
@Example:sb.sound.mute = 1;
@Description: The methods of sb.sound instances
@File: sound.js
@Description: Gets the current volume
@File: sound.js
@Param: Float volume between 0 and 1
@Example:mySound.setVolume(0.5);
@Description: sets the volume to zero for this sound but keeps playing
@File: sound.js
@Example:mySound.mute();
@Description: Plays the sound file
@File: sound.js
@Example:mySound.play();
@Description: sets the current pan position
@File: sound.js
@Param: float pan between -1 (left) and 1 (right)
@Example:mySound.setPan(0.5);
@Description: Moves the playhead to a certain position in milliseconds
@File: sound.js
@Example:mySound.setPosition(4135);
@Description: Moves the playhead to a certain position in percent of total
@File: sound.js
@Example:mySound.setPositionPercent(40);
@Description: Stops the sound file
@File: sound.js
@Example:mySound.play();
@Description: String The url of the mp3 file
@File: sound.js
@Description: Sets the global volume of all sounds
@File: sound.js
@Example:sb.sound.setGlobalVolume(0.5);
@Description: Stops all sounds playing on the page
@File: sound.js
@Example:sb.sound.stopAll();
//or
sb.sound.stopAll('yellow.mp3');
@Description: Gets the current pan position
@File: sound.js
@Return: float between -1 (left) and 1 (right)
@Example:mySound.getPan();
@Description: Gets the current position in milliseconds
@File: sound.js
@Return: Number return the current position in milliseconds
@Example:mySound.getPosition();
@Description: Gets the current position in percent of total
@File: sound.js
@Return: Number return the current position in percent of total
@Example:mySound.getPositionPercent();
@Description: Gets the current volume
@File: sound.js
@Return: float between 0 and 1
@Example:mySound.getVolume();