
If you find some bugs or missing functional in plugins, use Issues page on GitHub
ion.sound({
sounds: [
{
name: "metal_plate",
preload: true
},
{name: "metal_plate_2"},
{name: "pop_cork"},
{name: "snap"}
],
path: "static/sounds/",
preload: false,
multiplay: true,
volume: 0.9,
scope: this, // optional scope
ready_callback: myReadyCallback
});
// method to force sound loading
ion.sound.preload("pop_cork");
// using play for non preloaded sound
// will force loading process first
// and only when playback
ion.sound.play("pop_cork");
ion.sound({
sounds: [
{
// sprite name
name: "wd_sprite",
// sprite parts
sprite: {
"intro": [2, 3.4],
"part1": [13.5, 6.6],
"part2": [27.8, 1.76],
"part3": [33, 1.6],
"end": [44.5, 4.71]
}
}
],
path: "static/sounds/",
preload: true,
multiplay: false,
volume: 0.9
});
// controlling sprites
ion.sound.play("wd_sprite", {
part: "intro"
});
ion.sound.pause("wd_sprite", {
part: "intro"
});
ion.sound.stop("wd_sprite", {
part: "intro"
});
// etc.
// create sound
ion.sound({
sounds: [
{name: "witchdoctor"}
],
path: "static/sounds/",
preload: true,
multiplay: false
});
// destroy sound
ion.sound.destroy("witchdoctor");
// create sound
ion.sound({
sounds: [
{name: "door_bump"},
{name: "water_droplet_2"},
{name: "water_droplet_3"}
],
path: "static/sounds/",
preload: true,
multiplay: false,
ready_callback: function (obj) {
obj.name; // File name
obj.alias; // Alias (if set)
obj.ext; // File .ext
obj.duration; // Seconds
},
ended_callback: function (obj) {
obj.name; // File name
obj.alias; // Alias (if set)
obj.part; // Part (if sprite)
obj.start; // Start time (sec)
obj.duration; // Seconds
}
});
// destroy sound
ion.sound.destroy("witchdoctor");