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