I couldn't find an answer on StackOverflow that dealt with audio formats. I've come across some methods on how to implement sounds in UI (like this one), but what type of audio file type should I be using that will work across all devices including PCs, tablets, and phones for an HTML/CSS/JS based web app? Right now, my sounds only work on a PC and not on mobile when a certain button is clicked. I am using .ogg as my audio file.
// Source: https://codereview.stackexchange.com/questions/21604/playing-sound-on-a-button-click/42755#42755
$(document).ready(function() {
var obj = document.createElement("audio");
obj.setAttribute("src", "link/to/audio/click.mp3");
$.get();
$(".playSound").click(function() {
obj.play();
});
});
Thank you.