We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to use bytebeat.js as a module in my project. I installed the library using:
yarn add bytebeat.js (or npm)
yarn add bytebeat.js
Then, I tried to initialize it with the following code:
import ByteBeatNode from 'bytebeat.js'; async function start() { const context = new AudioContext(); context.resume(); // needed for safari await ByteBeatNode.setup(context); byteBeatNode = new ByteBeatNode(context); byteBeatNode.setType(ByteBeatNode.Type.byteBeat); byteBeatNode.setExpressionType(ByteBeatNode.ExpressionType.infix); byteBeatNode.setDesiredSampleRate(8000); await byteBeatNode.setExpressions(['((t >> 10) & 42) * t']); byteBeatNode.connect(context.destination); }
However, I get the following error:
Uncaught (in promise) SyntaxError: Unexpected token '{'
On the other hand, if I include the module as a submodule:
import ByteBeatNode from '@/vendors/html5bytebeat/dist/2.x/ByteBeat.module';
It works as expected but only in dev, not in production...
Am I missing something in the setup when using yarn? I guess I need a specific configuration for Babel, don't I?
The text was updated successfully, but these errors were encountered:
I don't know. If you follow these steps under "working example" does it work?
Sorry, something went wrong.
No branches or pull requests
I'm trying to use bytebeat.js as a module in my project. I installed the library using:
yarn add bytebeat.js
(or npm)Then, I tried to initialize it with the following code:
However, I get the following error:
Uncaught (in promise) SyntaxError: Unexpected token '{'
On the other hand, if I include the module as a submodule:
import ByteBeatNode from '@/vendors/html5bytebeat/dist/2.x/ByteBeat.module';
It works as expected but only in dev, not in production...
Am I missing something in the setup when using yarn? I guess I need a specific configuration for Babel, don't I?
The text was updated successfully, but these errors were encountered: