2023-12-07 13:45:22 +01:00
|
|
|
class Sound{
|
|
|
|
constructor(url){
|
2023-12-08 13:50:49 +01:00
|
|
|
this.sound = new Audio(url);
|
|
|
|
this.sound.type = "audio/mp3";
|
2023-12-07 13:45:22 +01:00
|
|
|
}
|
|
|
|
|
2023-12-08 13:50:49 +01:00
|
|
|
play(){
|
2023-12-08 19:31:22 +01:00
|
|
|
//this.sound.pause()
|
2023-12-08 18:29:33 +01:00
|
|
|
this.sound.currentTime=0;
|
|
|
|
this.sound.play()
|
2023-12-07 13:45:22 +01:00
|
|
|
}
|
|
|
|
}
|