您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.js 679B

12345678910111213141516171819202122232425
  1. // @flow
  2. // Script expects to find rnnoise webassembly binary in the same public path root, otherwise it won't load
  3. // During the build phase this needs to be taken care of manually
  4. import rnnoiseWasmInit from 'rnnoise-wasm';
  5. import RnnoiseProcessor from './RnnoiseProcessor';
  6. export { RNNOISE_SAMPLE_LENGTH } from './RnnoiseProcessor';
  7. export type { RnnoiseProcessor };
  8. let rnnoiseModule;
  9. /**
  10. * Creates a new instance of RnnoiseProcessor.
  11. *
  12. * @returns {Promise<RnnoiseProcessor>}
  13. */
  14. export function createRnnoiseProcessor() {
  15. if (!rnnoiseModule) {
  16. rnnoiseModule = rnnoiseWasmInit();
  17. }
  18. return rnnoiseModule.then(mod => new RnnoiseProcessor(mod));
  19. }