为什么nodejs不支持Web Audio API? [英] Why Web Audio API isn't supported in nodejs?

查看:877
本文介绍了为什么nodejs不支持Web Audio API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我理解 Web Audio API 是客户端功能,但nodejs基于ECMAScript的V8 Chrome客户端实现,其中包括 Web Audio API

为什么nodejs中没有完全支持 Web Audio API

是因为 AudioContext 基于全局窗口对象?

我在这里错过了一个点吗?

是否有计划让它在将来可用?

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.
Why there is no complete support of Web Audio API in nodejs ?
Is it because AudioContext is based on the global window object ?
Am I missing a point here ?
Is there a plan to make it available in the future ?

推荐答案

Node.js不支持Web Audio,因为它不是 JavaScript语言本身 - 它是一个单独的网络平台JavaScript API

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.

您可以将其视为Web Workers, requestAnimationFrame XMLHttpRequest - 它们是浏览器JavaScript环境的一部分,但它们对其他运行时并不一定有意义。

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是一个通用的JavaScript引擎;它不包括Web平台功能。这是Node.js能够使用它的原因之一。 Chrome的Web音频实施是渲染引擎Blink的一部分。

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.

web-audio-api npm模块旨在为Node.js实现Web Audio。

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

这篇关于为什么nodejs不支持Web Audio API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆