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