• Hi all,
    I added this my code and works well in WP: sound effect when clicking links, inputs, etc.: they are only very small effects, few kb in mp3.
    Well in Chrome, Opera, Firefox and other browsers: zero in Safari and IE (in IE work audio for other audio effects, in Safari zero on zero).

    jQuery(document).ready(function( $ ) {
    var clickUrl = 'https://www.biomotive.com.hk/wp-content/uploads/sounds/bubble.mp3';
    var sndClick = new Audio(clickUrl);
    $('input, button').click( () => sndClick.play() );
    $(sndClick).prop("volume", 0.6);
    
    var swapUrl = 'https://www.biomotive.com.hk/wp-content/uploads/sounds/swap.mp3';
    var sndSwap = new Audio(swapUrl);
    $('select').click( () => sndSwap.play() );
    $(sndSwap).prop("volume", 0.6);
    
    var blopUrl = 'https://www.biomotive.com.hk/wp-content/uploads/sounds/blop.mp3';
    var sndBlop = new Audio(blopUrl);
    $('a').click( () => sndBlop.play() );
    $(sndBlop).prop("volume", 0.7);
    })(jQuery);

    I know that Safari might have problems to tried also to add the preload prop:
    $(sndClick).prop('preload','auto');
    but seems no way, either Safari 5 on PC and Safari 10 on mac OS.

    Any suggestion?
    Thx
    Mauro

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘audio effects ok but not working in IE and Safari’ is closed to new replies.