How to create pink noise with the API? #258
-
I'm looking for a way to create pink noise with the audio api. I found this, but wasn't able to make it produce anything! 😅 The examples on the post do not seem to work either... |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hey, thanks for reaching us! :) instead of using ScriptProcessorNode you can use AudioBufferSourceNode as it is suggested in the white nose section :) by reusing the values from the tutorial you've linked, we can create something like that:
You can cache this buffer somewhere (using useRef f.e.) and play it using audio buffer source node:
|
Beta Was this translation helpful? Give feedback.
-
Btw. as for the web environment, |
Beta Was this translation helpful? Give feedback.
-
Yay! It works, on native as well as web! 🥳 Thanks a bunch! 🙏 |
Beta Was this translation helpful? Give feedback.
Hey, thanks for reaching us! :)
instead of using ScriptProcessorNode you can use AudioBufferSourceNode as it is suggested in the white nose section :)
by reusing the values from the tutorial you've linked, we can create something like that: