Note that there are some explanatory texts on larger screens.

plurals
  1. POIon.Sound 1.1.0 JQuery javascript Reponse
    primarykey
    data
    text
    <p>I have a question about a free plugin av on <a href="http://ionden.com/a/plugins/ion.sound/en.html" rel="nofollow">http://ionden.com/a/plugins/ion.sound/en.html</a></p> <p>My current javascript code look like this</p> <pre><code>(function ($) { if($.ionSound) { return; } var settings = {}, soundsNum, canMp3, url, i, sounds = {}, playing = false; var createSound = function(name){ sounds[name] = new Audio(); canMp3 = sounds[name].canPlayType("audio/mp3"); if(canMp3 === "probably" || canMp3 === "maybe") { url = settings.path + name + ".mp3"; } else { url = settings.path + name + ".ogg"; } $(sounds[name]).prop("src", url); sounds[name].load(); sounds[name].volume = settings.volume; }; var playSound = function(name){ var $sound = sounds[name], playingInt; if(typeof $sound === "object" &amp;&amp; $sound !== null) { if(!settings.multiPlay &amp;&amp; !playing) { $sound.play(); playing = true; playingInt = setInterval(function(){ if($sound.ended) { clearInterval(playingInt); playing = false; } }, 250); } else if(settings.multiPlay) { if($sound.ended) { $sound.play(); } else { try { $sound.currentTime = 0; } catch (e) {} $sound.play(); } } } }; $.ionSound = function(options){ settings = $.extend({ sounds: [ "water_droplet" ], path: "static/sounds/", multiPlay: true, volume: "0.5" }, options); soundsNum = settings.sounds.length; if(typeof Audio === "function" || typeof Audio === "object") { for(i = 0; i &lt; soundsNum; i += 1){ createSound(settings.sounds[i]); } } $.ionSound.play = function(name) { playSound(name); }; }; $.ionSound.destroy = function() { for(i = 0; i &lt; soundsNum; i += 1){ sounds[settings.sounds[i]] = null; } soundsNum = 0; $.ionSound.play = function(){}; }; </code></pre> <p>}(jQuery));</p> <p>My question is the sound triggers slow (Interval response) does someone knows where this can be set/create to respond like 1 second or more even instant onclick of a button i need that else if a user click to fast the sound is not respond fast enough</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload