pxt-ev3/sim/state/sounds.ts
Sam El-Husseini 83700b4e14
Music field editor (#529)
Music fiele editor
2018-04-17 22:16:19 -07:00

29 lines
514 B
TypeScript

namespace pxsim.music {
export function fromWAV(buf: RefBuffer) {
return incr(buf)
}
export function stopAllSounds() {
SoundMethods.stop()
}
}
namespace pxsim.SoundMethods {
let audio: HTMLAudioElement;
export function buffer(buf: RefBuffer) {
return incr(buf)
}
export function play(buf: RefBuffer) {
return pxsim.AudioContextManager.playBufferAsync(buf);
}
export function stop() {
pxsim.AudioContextManager.stop();
}
}