DefinitelyTyped/types/audio-play/audio-play-tests.ts
Jeff Peterson 0f48f35cd2 Add types for audio-play and audio-context (#38119)
* Add types for audio-context and audio-play

* Test fixes

* More test fixes

* PR comments

* Remove excessive exporting
2019-09-06 16:25:07 -07:00

7 lines
232 B
TypeScript

import audioPlay = require("audio-play");
const buffer = new AudioBuffer({length: 2, sampleRate: 22000});
const thisSound = audioPlay(buffer, { autoplay: true }, () => console.log('stopped!'));
thisSound.pause();
thisSound.play();