Comments (11)
@prioleaud Have you tried Omnitone? That might be a more appropriate solution.
from resonance-audio-web-sdk.
@brianchirls No I haven't tried it. Thanks for the suggestion! In what way, do you think it will be better suited?
from resonance-audio-web-sdk.
Since Resonance Audio is powered by Omnitone, is there a way to access the Omnitone object from Resonance Audio, or do you have to load it separately? It would be great if there was some documentation on creating an ambisonic node and connecting it to the audioContext.
from resonance-audio-web-sdk.
It seems as though all nodes created with cxt.createMediaElementSource() are one channel mono. I'm not sure how to feed the ambisonic input a 4-channel file. That seems to be the issue. Furthermore, it seems that regular single source nodes are converted to mono as well even if your is a stereo file.
from resonance-audio-web-sdk.
Okay I figured it out...
Live site: https://noahneumark.github.io/aframe-resonance-audio/
Code: https://github.com/noahneumark/spatial_audio
from resonance-audio-web-sdk.
Thanks @noahneumark, just found this thread as I'm trying to do the same thing. Looking at your commits on your project, this seems more complicated than it should be. Appreciate you sharing this.
from resonance-audio-web-sdk.
My component kit is complicated because it has far more features than just being an ambisonic player. That said, if you are just trying to implement playing ambisonic files, you need to include a function that does this (from resonance-audio-room
component):
connectBuffer() {
//Create 4 channel splitter
this.splitter = this.resonanceAudioContext.createChannelSplitter(4);
//Connect bufferNode to splitter
this.bufferNode.connect(this.splitter)
//Create merger as ambisonicSourceNode
this.ambisonicSourceNode = this.resonanceAudioContext.createChannelMerger()
//Connect splitter to ambisonicSourceNode
this.splitter.connect(this.ambisonicSourceNode, 0, 0)
this.splitter.connect(this.ambisonicSourceNode, 1, 1)
this.splitter.connect(this.ambisonicSourceNode, 2, 2)
this.splitter.connect(this.ambisonicSourceNode, 3, 3)
//Setup ambisonicInput to receive source
this.resonanceAudioScene.ambisonicInput.channelInterpretation = "discrete"
this.resonanceAudioScene.ambisonicInput.channelCountMode = "clamped-max"
this.resonanceAudioScene.ambisonicInput.channelCount = 4
//Connect ambisonicSourceNode to ambisonicInput
this.ambisonicSourceNode.connect(this.resonanceAudioScene.ambisonicInput)
//Set up
this.resonanceAudioScene.ambisonicInput.gain.value = this.data.gain
if (this.data.loop) {
this.bufferNode.loop = true
}
if (this.data.autoplay && this.resonanceAudioContext.state === "running") {
this.bufferNode.start()
}
this.connectedSrc = true
}
Let me know if you have any questions about this.
from resonance-audio-web-sdk.
As suggested by @brianchirls, you'd be better off using Omnitone if the goal is to simply play an ambisonic media. (FOA, SOA, TOA).
@prioleaud Please feel free to follow up or close the issue if needed.
from resonance-audio-web-sdk.
At least some of the other Resonance implementations, iOS for example, seem to have playing sound fields as a feature. The confusion here is that the web SDK doesn't, though it seems to include internals to do so.
As for why not just using Omnitone, the reason is to combine sound fields with dynamically spatialize sounds.
from resonance-audio-web-sdk.
@jwarchol That makes sense. Thanks for the clarification. So the solution is to expose the Omnitone decoder as a part of API?
from resonance-audio-web-sdk.
Perhaps. I think @prioleaud's original notion of doing something like audioElementSource.connect(resonanceAudioScene.ambisonicInput);
feels good, if that sort of an interface is possible.
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
- module loading HOT 7
- 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.