可以控制另一台PC的音频和麦克风级别的C#代码 [英] C# code that can control audio and microphone level of another PC

查看:90
本文介绍了可以控制另一台PC的音频和麦克风级别的C#代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



当我读到标题时,它听起来像黑客,但它完全不同。



我的场景是两台PC安装了我创建的相同C#软件。使用这个软件,他们应该看到彼此的音频和麦克风级别,他们可以改变他们和其他音频和麦克风级别。 />


我知道如何管理音频和麦克风级别,但是如何在安装相同软件时控制其他PC?



感谢您的回答!

Hello,

When I read the title, It sounded like hacking, but it is completely different.

My scenario is "Two PCs have installed the same C# software that I created. With this software, they should see audio and microphone levels of each other and they can change both theirs and others audio and mic levels".

I know how to manage Audio and mic levels, but how can I control other PC when the same software is installed?

Thank you for your answers!

推荐答案

显然,如果此计算机没有运行某些在网络上通信的进程,则无法控制另一台计算机上的任何内容并遵守你的命令。



首先,你需要在本地计算机上控制音频。使用.NET的一个即用型库是NAudio: http://naudio.codeplex.com/ [ ^ ]。



现在,您需要创建一个可以侦听网络连接的应用程序(即,充当网络应用程序的服务器部分),接受连接并接收和发送数据,因此接收的数据可以是控制命令。这可以在几个不同级别的网络,远程处理或WCF之一上完成。

请在我过去的解决方案中查看我对这些方法的概述:

我可以将byte []发送到其他电脑 [ ^ ],

沟通b / w LAN上的两个Windows应用程序。 [ ^ ]。



此类网络应用程序最适合的形式是Windows服务:

http://en.wikipedia.org/wiki/Windows_Service [ ^ ],

http://technet.microsoft.com/en-us/library/cc783643%28v=ws.10%29.aspx [ ^ ],

http://msdn.microsoft.com/en-us /library/ms685141.aspx [ ^ <使用.NET开发Windows服务,从这里开始: http://msdn.microsoft.com/en-us/library/zt39148a.aspx [ ^ ]。



有CodeProject的文章可能会对您有所帮助:

Windows服务错误 [ ^ ],

使用UI配置Windows服务 [ ^ ]。



这就是所涉及的一切。您可能需要考虑许多高级功能,身份验证等。



-SA
Apparently, you cannot control anything on the other computer if this computer does not run some process which communicates on the network and obeys your commands.

First of all, you need to control audio on a local computer. One of the ready-to-use libraries to do it with .NET is NAudio: http://naudio.codeplex.com/[^].

Now, you need to create an application which could listen to a network connection (that is, to act as a server part of a network application does), accepts connection and received and sends data, so the received data could be control commands. This can be done on one of several different levels of networking, remoting or WCF.
Please see my overview of these approaches in my past solutions:
how i can send byte[] to other pc[^],
Communication b/w two Windows applications on LAN.[^].

The most adequate form for such network application is the Windows Service:
http://en.wikipedia.org/wiki/Windows_Service[^],
http://technet.microsoft.com/en-us/library/cc783643%28v=ws.10%29.aspx[^],
http://msdn.microsoft.com/en-us/library/ms685141.aspx[^].

To develop a Windows Service with .NET, start here: http://msdn.microsoft.com/en-us/library/zt39148a.aspx[^].

There CodeProject articles could be helpful:
Windows services Error[^],
Configure Windows Service with UI[^].

That's all which is involved. There can be many advanced featured you would need to consider, authentication, and so on.

—SA

这篇关于可以控制另一台PC的音频和麦克风级别的C#代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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