简体   繁体   中英

How to get data from computer's microphone and camera in node.js application?

I want to make a node.js application that can access computer's microphone and camera. One way of doing this would be to create a web server and use browser's webrtc API but I don't wanna do that I don't even want to open the browser. Is there a way that my app can access the computer's microphone and camera? Ask me if the explanation is not clear.

Node.js runs on the server and has no GUI. (Although who knows what people already wrote for node.js these days). Also, although node.js is cross platform, communication to the microphone and camera is not. Every OS has its own way, its own APIs and drivers.

If you're trying to make a standalone application, that captures audio and video and shows it to the client on the same machine, node.js is not the best technology to use in this case. Please provide more information on the purpose of your application, the platform etc. and maybe we can help you more.

Edit: Look at a similar question Accessing WebCam with NodeJS Note that WebRTC is not a capturing technology, it's a streaming technology. The capturing of the video and audio is implemented in the browser and the implementation is different for every platform. For example Chrome for Linux and Chrome for Windows are different pieces of software and implement the capturing differently. Only the webRTC API is the same for the web developer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM