Git Product home page Git Product logo

Comments (11)

brianchirls avatar brianchirls commented on August 19, 2024

@prioleaud Have you tried Omnitone? That might be a more appropriate solution.

from resonance-audio-web-sdk.

prioleaud avatar prioleaud commented on August 19, 2024

@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.

noahneumark avatar noahneumark commented on August 19, 2024

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.

noahneumark avatar noahneumark commented on August 19, 2024

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.

noahneumark avatar noahneumark commented on August 19, 2024

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.

jwarchol avatar jwarchol commented on August 19, 2024

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.

noahneumark avatar noahneumark commented on August 19, 2024

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.

hoch avatar hoch commented on August 19, 2024

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.

jwarchol avatar jwarchol commented on August 19, 2024

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.

hoch avatar hoch commented on August 19, 2024

@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.

jwarchol avatar jwarchol commented on August 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.