0

I'm trying to create a small snippet that allows me to make small audio buffers with simple sine waves in nodeJS. I found some code here on StackOverflow that I edited a little. It was intended for a web environment with new window.audioContext. After a bit of searching, I only found an NPM module called audio-context.

What I'm trying to achieve is to make a function that is capable of layering waves of different forms and differing frequency.

Sadly, after a lot of trying and finally looking into the module itself, it seems the only available contexts are from web environments.

Any effective way to do this? I can't believe there is no proper way to do direct buffer work like this with just Node.Js.

More general solutions would probably help me more.

The code for generating sine waves and writing them into the AudioBuffer was from the solution to this: Generate sine wave and play it in the browser

jackik
  • 83
  • 1
  • 1
  • 8
  • Sadly Web Audio API is not implemented in Node.js, so the npm module _audio-context_ will not help you much. You could try instead [web-audio-api](https://github.com/audiojs/web-audio-api). – TGrif Feb 15 '20 at 11:00
  • That's a lot for your comment! I checked it out and it seems exactly what I was looking for. You've answered my question exactly ^^. – jackik Feb 15 '20 at 19:50
  • Glad to help, I'll eventually post an answer when I can propose a concrete example of use for your case. – TGrif Feb 15 '20 at 20:14

0 Answers0