Why Web Audio API isn't supported in nodejs?

后端 未结 1 427
臣服心动
臣服心动 2021-01-11 12:56

I understand Web Audio API is a client side feature but nodejs is based on V8 Chrome client side implementation of ECMAScript, which include Web Audio API.

相关标签:
1条回答
  • 2021-01-11 13:02

    Node.js doesn't support Web Audio because it isn't part of the JavaScript language itself - it's a separate web platform JavaScript API.

    You can think of it like Web Workers, requestAnimationFrame or XMLHttpRequest - they are part of the browser's JavaScript environment, but they don't necessarily make sense for other runtimes.

    V8 is a generic JavaScript engine; it doesn't include web platform features. That's one of the reasons that Node.js is able to use it. Chrome's implementation of Web Audio is part of Blink, the rendering engine.

    The web-audio-api npm module aims to implement Web Audio for Node.js.

    0 讨论(0)
提交回复
热议问题