-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
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
module loading #24
Comments
I've updated the resonance-audio source to ea6 style module loading, and the build looks good. However, I am still struggling to get Omnitone (required in Listener.js) to load properly from the build. |
Can you post the errors you’re getting?
…On Tue, Feb 5, 2019 at 7:22 PM Lonce Wyse ***@***.***> wrote:
I've updated the resonance-audio source to ea6 style module loading, and
the build looks good. However, I am still struggling to get Omnitone
(required in Listener.js) to load properly from the build.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGDsNpDK1cjEQlmP3bCtKIvagUdFmRXTks5vKiBAgaJpZM4afhHe>
.
|
Hi Drew,
First, of course, i made the changes necessary for es6 module loading in all the resonance-audio-web-sdk/src files, such as: I then turned to importing Omnitone in the one necessary place, listener.js : However, the reference (later in listener.js) to One remaining bug popped up. The reference in utils.js to Now I am getting a build of resonance-audio.js that seems to be working fine with ES6 importing! Thanks again for this cool library, |
Excellent news!
…On Tue, Feb 5, 2019 at 11:00 PM Lonce Wyse ***@***.***> wrote:
Hi Drew,
I do believe I've got it working now, but had to make a couple of minor changes in the code to do so.
First, of course, i made the changes necessary for ea6 module loading in
all the resonance-audio-web-sdk/src files, such as:
//const Utils = require('./utils.js'); import Utils from './utils.js'
I then turned to importing Omnitone in the one necessary place,
listener.js :
//import * as foo from '../node_modules/omnitone/build/omnitone.js' import
Omnitone from '../node_modules/omnitone/build/omnitone.esm.js'
However, the reference (later in listener.js) to
Omnitone.Omnitone.createFOARenderer(context, {});
was creating a problem. Since I couldn't figure out how to construct an
import statement that would create this nested structure, I just changed
the nested reference (in the two places it occurs) to:
Omnitone.createFOARenderer(context, {})
That solved the issue!
One remaining bug popped up. The reference in utils.js to
exports.EPSILON_FLOAT
bombed since 'exports' is no longer defined. Changing it to what it
probably should have been in the first place:
Utils.EPSILON_FLOAT
solved that issue.
Now I am getting a build of resonance-audio.js that seems to be working
fine with EA6 importing!
Thanks again for this cool library,
- lonce
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGDsNrj594JiTq-zVCwxD86Iy5PFE_7Eks5vKlNFgaJpZM4afhHe>
.
|
FWIW, Omnitone recently updated (v1.3) and now it supports ES6 module. Perhaps we should use that in Resonance as well? |
Same issue here. Even though I built from the original source code, it caused problem. The following is the output from running
I think these are the lines of code that caused the problem. I tried replacing it with newer version of omnitone, but still it cannot pass the test. |
@iooops / anyone else running into this issue - You can fix it minimally by making these two changes:
then |
Feature request:
I would like to import resonance-audio in an ecma6 module so that I don't have to force users to import with a script tag in their html file.
Thanks for a great library,
- lonce
The text was updated successfully, but these errors were encountered: