If you find some bugs or missing functional in plugins, use Issues page on GitHub
// init bunch of sounds ion.sound({ sounds: [ {name: "beer_can_opening"}, {name: "bell_ring"}, {name: "branch_break"}, {name: "button_click"} ], // main config path: "static/sounds/", preload: true, multiplay: true, volume: 0.9 }); // play sound ion.sound.play("beer_can_opening");
ion.sound({ sounds: [ { // individual config name: "button_click_on", path: "sounds/group1/", volume: 0.3 }, { name: "button_push", path: "sounds/group2/", volume: 0.6 }, { name: "button_tiny", preload: false }, { name: "camera_flashing", multiplay: false, preload: false } ], // main config path: "sounds/", preload: true, multiplay: true }); // play sound ion.sound.play("button_click_on");
ion.sound({ sounds: [ {name: "camera_flashing_2"}, {name: "cd_tray"}, {name: "computer_error"}, {name: "door_bell"} ], // main config path: "static/sounds/", preload: true, multiplay: true, volume: 0.1 // default volume is 10% }); // overriding volume in methods ion.sound.play("camera_flashing_2", { volume: 1.0 }); ion.sound.play("cd_tray", { volume: 0.7 }); ion.sound.play("computer_error", { volume: 0.5 }); ion.sound.play("door_bell", { volume: 0.2 });
ion.sound({ sounds: [ { alias: "s1", name: "door_bump" }, { alias: "s2", name: "glass" }, { alias: "s3", name: "keyboard_desk", loop: 3 }, { alias: "s4", name: "light_bulb_breaking", loop: true } ], path: "static/sounds/", preload: false, volume: 1 }); ion.sound.play("s1", { loop: 7 }); ion.sound.play("s2", { loop: 5 }); ion.sound.play("s3"); ion.sound.play("s4"); // Set master volume ion.sound.volume({volume: 0.5});
ion.sound({ sounds: [ {name: "witchdoctor"} ], path: "static/sounds/", preload: false, multiplay: false, volume: 1 }); // play, pause and stop ion.sound.play("witchdoctor"); ion.sound.pause("witchdoctor"); ion.sound.stop("witchdoctor");