mirror of
https://github.com/Aviortheking/games.git
synced 2025-04-23 11:22:09 +00:00
17 lines
268 B
TypeScript
17 lines
268 B
TypeScript
export default class SoundManager {
|
|
private audio: HTMLAudioElement
|
|
public constructor(path: string) {
|
|
this.audio = new Audio(path)
|
|
this.audio.load()
|
|
this.audio.volume = .8
|
|
}
|
|
|
|
public play() {
|
|
this.audio.play()
|
|
}
|
|
|
|
public end() {
|
|
this.audio.pause()
|
|
}
|
|
}
|