GithubHelp home page GithubHelp logo

Comments (7)

MVSICA-FICTA avatar MVSICA-FICTA commented on May 5, 2024 1

Looks like a fine integration, nicer than I had expected 😄 Will investigate and have a few more questions / suggestions...

from virtual-audio-graph.

benji6 avatar benji6 commented on May 5, 2024

Thanks! Yeah I think it's possible. I'm not sure what the API should be though. My initial thought is to let the user call addModule themselves and provide something like a createWorkletNode function that is called with the worklet node's name and returns a virtual audio node creator function that works in the same way as all the standard ones provided (e.g. oscillator, gain etc.):

const audioContext = new AudioContext()

const virtualAudioGraph = createVirtualAudioGraph({audioContext})

audioContext.audioWorklet.addModule('my-node.js').then(() => {
  const myNode = createWorkletNode('my-node')

  virtualAudioGraph.update({
    0: myNode('output'),
    1: oscillator(0),
  })
})

I'm a bit unsure about how testing is going to work for this as I've been using https://github.com/mohayonao/web-audio-test-api and it doesn't look like it has AudioWorklet support so will have to have a think about that 🤔

What do you think about the API though? Any suggestions?

from virtual-audio-graph.

benji6 avatar benji6 commented on May 5, 2024

Cheers, when I've got a bit of spare time I'll start looking at building it!

from virtual-audio-graph.

MVSICA-FICTA avatar MVSICA-FICTA commented on May 5, 2024

Awesome! So the way I understand this is that an AudioWorklet can be used in a virtual-audio-graph like any other audio node and connected to other AudioContext nodes. Does this also allow the params the AudioWorklet might expose to be updated by the virtualAudioGraph.update function?

Have you seen Genish.js? Looks like it will also be able to work with AudioWorklets according to charlieroberts/genish.js#8

from virtual-audio-graph.

benji6 avatar benji6 commented on May 5, 2024

Hey, yep that's exactly how I envision it working!

And I've not seen Genish.js before - looks really cool, thanks for sharing :)

from virtual-audio-graph.

benji6 avatar benji6 commented on May 5, 2024

🎉 This issue has been resolved in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from virtual-audio-graph.

benji6 avatar benji6 commented on May 5, 2024

Hey! I've added support for AudioWorklets now. It's working in the new documentation, but I am lacking unit test coverage atm. I don't think that's a major issue right now because it's so new and experimental so can come back to that later! Thanks for raising the issue and let me know if you have any questions! :)

from virtual-audio-graph.

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.