I'm creating a helper GNOME extension for my theme. The helper extension was meant to be used to add some sounds when I click a button, however, I can't find a solution (and an extension) that shows how to add the sounds and how to call them.
Actually, I found some questions and articles that explains how to add an audio function, but most of it requires HTML.
I've tried using this code (through the Looking Glass and the extension.js file) from here, which says that it doesn't require HTML things:
function playSound() {
var audio = new Audio('/path/to/audio/file');
audio.play();
}
However, it returned unknown function error for Audio():
ReferenceError: Audio is not defined
Can someone help me? Thanks!