简体   繁体   English

如何通过 Node JS(或命令行)更改系统音频输出/输入设备

[英]How can I change my system audio output / input device through Node JS (or command line)

I'm attempting to build a little dashboard for my computer in Electron and something that would be really useful for me is having the ability to change my audio output at the click of a button (on the electron app).我正在尝试在 Electron 中为我的计算机构建一个小仪表板,对我来说真正有用的是能够通过单击按钮(在电子应用程序上)更改我的音频输出。 Is there any way this is possible through the Node API or a command through Command Prompt/PowerShell?有什么办法可以通过节点 API 或通过命令提示符/PowerShell 的命令实现? I'm open to any options that would allow this outside of Node/Electron/CMD as well我对任何允许在 Node/Electron/CMD 之外进行的选项持开放态度

This link might have what you are looking for (CMD example). 链接可能包含您要查找的内容(CMD 示例)。 To execute cmd/bash you can use child_process / node-cmd / shelljs packages.要执行 cmd/bash,您可以使用child_process / node-cmd / shelljs包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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