DefinitelyTyped/types/meyda/meyda-tests.ts
zhoutwo 78c2fa924f
🤖 Merge PR #44996 Remove unnecessary requirements of arguments in @types/meyda for meyda 5.0.1 by @zhoutwo
* Remove requiring the features argument

* Update meyda-tests.ts

* Fix constructor options based on runtime

* Add more tests
2020-05-22 14:52:01 -07:00

27 lines
486 B
TypeScript

function dummyNumbers(a: number): void {}
const AC = new AudioContext();
const result = Meyda.extract('rms', []);
if (result) {
if (result.zcr) {
dummyNumbers(result.zcr);
}
}
const analyzer = Meyda.createMeydaAnalyzer({
audioContext: AC,
source: AC.createOscillator(),
bufferSize: 2048,
});
Meyda.windowing([], Meyda.windowingFunction);
analyzer.start();
analyzer.stop();
analyzer.get();
analyzer.start('rms');
analyzer.stop();
analyzer.get(['rms']);