<script type="module">
import { Module } from './aubio.js'
var pitchDetector = new (Module().AubioPitch)('default', bufferSize, 1, audioContext.sampleRate);
</script>
Uncaught (in promise) TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
这个报错是因为babel强制使用了严格模式,所以我在工程里添加了babel-plugin-transform-remove-strict-mode这个包,并且把.babelrc文件修改为下面的代码
{
"presets": [
["env"],
"stage-3"
],
"plugins": [
"transform-remove-strict-mode"
]
}
Uncaught (in promise) TypeError: (0 , _aubio.Module)(...).AubioPitch is not a constructor