class Sound{ constructor(url){ this.sound = new Audio(url); this.sound.type = "audio/mp3"; } play(){ //this.sound.pause() this.sound.currentTime=0; this.sound.play() } }