2017-10-30 17:25:58 +00:00
|
|
|
|
|
|
|
namespace pxsim.music {
|
|
|
|
export function fromWAV(buf: RefBuffer) {
|
|
|
|
return incr(buf)
|
|
|
|
}
|
2017-12-13 16:31:42 -08:00
|
|
|
|
2017-12-15 10:42:44 -08:00
|
|
|
export function stopAllSounds() {
|
2017-12-13 16:31:42 -08:00
|
|
|
SoundMethods.stop()
|
|
|
|
}
|
2017-10-30 17:25:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace pxsim.SoundMethods {
|
2017-12-13 16:31:42 -08:00
|
|
|
let audio: HTMLAudioElement;
|
2017-10-30 17:25:58 +00:00
|
|
|
|
|
|
|
export function buffer(buf: RefBuffer) {
|
|
|
|
return incr(buf)
|
|
|
|
}
|
|
|
|
|
2018-01-18 13:53:33 -08:00
|
|
|
export function play(buf: RefBuffer) {
|
|
|
|
return pxsim.AudioContextManager.playBufferAsync(buf);
|
2017-10-30 17:25:58 +00:00
|
|
|
}
|
2017-12-13 16:31:42 -08:00
|
|
|
|
|
|
|
export function stop() {
|
2018-04-17 22:16:19 -07:00
|
|
|
pxsim.AudioContextManager.stop();
|
2017-12-13 16:31:42 -08:00
|
|
|
}
|
|
|
|
|
2017-10-30 17:25:58 +00:00
|
|
|
}
|
|
|
|
|