Core Docs | Additional Modules Docs

sb.sound


@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();

sb.sound.muteAll


@Description: Mutes all sounds playing on the page
@File: sound.js
@Example:
sb.sound.muteAll();
//or
sb.sound.muteAll('yellow.mp3');

sb.sound.muted


@Description: When set to 1, sounds will not play
@File: sound.js
@Example:
sb.sound.mute = 1;

sb.sound.prototype


@Description: The methods of sb.sound instances
@File: sound.js

sb.sound.prototype.getVolume


@Description: Gets the current volume
@File: sound.js
@Param: Float volume between 0 and 1
@Example:
mySound.setVolume(0.5);

sb.sound.prototype.mute


@Description: sets the volume to zero for this sound but keeps playing
@File: sound.js
@Example:
mySound.mute();

sb.sound.prototype.play


@Description: Plays the sound file
@File: sound.js
@Example:
mySound.play();

sb.sound.prototype.setPan


@Description: sets the current pan position
@File: sound.js
@Param: float pan between -1 (left) and 1 (right)
@Example:
mySound.setPan(0.5);

sb.sound.prototype.setPosition


@Description: Moves the playhead to a certain position in milliseconds
@File: sound.js
@Example:
mySound.setPosition(4135);

sb.sound.prototype.setPositionPercent


@Description: Moves the playhead to a certain position in percent of total
@File: sound.js
@Example:
mySound.setPositionPercent(40);

sb.sound.prototype.stop


@Description: Stops the sound file
@File: sound.js
@Example:
mySound.play();

sb.sound.prototype.url


@Description: String The url of the mp3 file
@File: sound.js

sb.sound.stopAll


@Description: Sets the global volume of all sounds
@File: sound.js
@Example:
sb.sound.setGlobalVolume(0.5);

sb.sound.stopAll


@Description: Stops all sounds playing on the page
@File: sound.js
@Example:
sb.sound.stopAll();
//or
sb.sound.stopAll('yellow.mp3');

sb.sound.prototype.getPan


@Description: Gets the current pan position
@File: sound.js
@Return: float between -1 (left) and 1 (right)
@Example:
mySound.getPan();

sb.sound.prototype.getPosition


@Description: Gets the current position in milliseconds
@File: sound.js
@Return: Number return the current position in milliseconds
@Example:
mySound.getPosition();

sb.sound.prototype.getPositionPercent


@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();

sb.sound.prototype.getVolume


@Description: Gets the current volume
@File: sound.js
@Return: float between 0 and 1
@Example:
mySound.getVolume();