Comments (7)
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.
from resonance-audio-web-sdk.
from resonance-audio-web-sdk.
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 es6 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 :
// Omnitone = require('../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 and work as expected, 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 ES6 importing!
Thanks again for this cool library,
- lonce
from resonance-audio-web-sdk.
from resonance-audio-web-sdk.
FWIW, Omnitone recently updated (v1.3) and now it supports ES6 module. Perhaps we should use that in Resonance as well?
from resonance-audio-web-sdk.
Same issue here.
Even though I built from the original source code, it caused problem.
The following is the output from running npm run test
:
Listener
✖ "before each" hook for "Verify module constructor."
Chrome 72.0.3626 (Mac OS X 10.14.3)
TypeError: Cannot read property 'createFOARenderer' of undefined
at new Listener (build/resonance-audio.js:933:40)
at Context.<anonymous> (test/test-listener.js:33:16)
ResonanceAudio
✖ "before each" hook for "Verify module constructor."
Chrome 72.0.3626 (Mac OS X 10.14.3)
TypeError: Cannot read property 'createFOARenderer' of undefined
at new Listener (build/resonance-audio.js:933:40)
at new ResonanceAudio (build/resonance-audio.js:3859:20)
at Context.<anonymous> (test/test-resonance-audio.js:33:13)
Source
✖ "before each" hook for "Ensure module produces output."
Chrome 72.0.3626 (Mac OS X 10.14.3)
TypeError: Cannot read property 'createFOARenderer' of undefined
at new Listener (build/resonance-audio.js:933:40)
at new ResonanceAudio (build/resonance-audio.js:3859:20)
at Context.<anonymous> (test/test-source.js:36:13)
`const Omnitone = require('../node_modules/omnitone/build/omnitone.js');`
if (this._ambisonicOrder == 1) {
this._renderer = Omnitone.Omnitone.createFOARenderer(context, {});
} else if (this._ambisonicOrder > 1) {
this._renderer = Omnitone.Omnitone.createHOARenderer(context, {
ambisonicOrder: this._ambisonicOrder,
});
}
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.
from resonance-audio-web-sdk.
@iooops / anyone else running into this issue - You can fix it minimally by making these two changes:
-
In src/listener.js. Replace
Omnitone.Omnitone.createFOARenderer
withOmnitone.createFOARenderer
Omnitone.Omnitone.createHOARenderer
withOmnitone.createHOARenderer
-
In 'node_modules/omnitone/build/omnitone.js'. Add:
module.exports = Omnitone;
to very bottom part of the file.
then npm test
should run successfully
from resonance-audio-web-sdk.
Related Issues (20)
- Directivity patterns, occlusion and reflections
- setRoomProperties throws an error HOT 11
- require Omnitone without relative paths HOT 1
- PannerNode vs TresureHunt
- Severe bug in ResonanceAudio.setRoomProperties() HOT 1
- Not working on Chrome HOT 5
- Typescript definitions
- Spatial audio doesn't work in iOS12.01 safari HOT 4
- Reverb is always mono on any browser HOT 4
- Confirming exactly what the "ambisonicOutput" is HOT 6
- Web SDK Documentation title indicates Unity
- How to download ambisonics file HOT 4
- Smooth transition when using sliders to set params HOT 3
- L R reverse HOT 3
- ssoruce spread not working on the web version
- Only Left speaker HOT 1
- CPU benchmark utility hangs HOT 2
- audioContext.createMediaStreamSource instead of audioContext.createMediaElementSource? HOT 1
- Audio stuttering/popping with Three.js and First Person camera
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resonance-audio-web-sdk.