.NET 视频音频聊天
我是应用程序开发方面的初学者。
到目前为止,我已经用 C# 开发了一个对等游戏 BattleShips 和用 Java 开发了一个对等游戏 Connect 4。
对于我的下一个项目,我决定采用多媒体。
我想实现一个点对点聊天程序,该程序使用音频/视频流传输到每个客户端以及文本聊天,也许还可以传输文件。我想用 C# 实现它。
我的问题是应该从哪里开始?
我已经阅读过SO和其他各种来源,但由于我缺乏经验,它仍然被证明是神秘的。
任何新手级别的提示都是最受欢迎的,即寻找相对容易理解的教程。
i am a beginner in terms of application development.
so far i have developed a peer to peer game of BattleShips in C# and a peer to peer game of Connect 4 in Java.
for my next project i have decided to go multimedia.
i would like to implement a peer to peer chat program that uses Audio/Video streaming to each client as well as text chat and maybe file transfer also. i would like to implement it in C#.
my question is where should start?
i have read through SO and various other sources but due to my lack of experience it is still proving to be cryptic.
any tips at a newbie level are most welcome i.e. looking for relatively easy to understand tutorials.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看一下 Jabber (XMPP) - 它是专门为您描述的任务而设计的。 Jabber-net 是一个有用的 .NET 库。仅供参考 Google IM 使用 Jabber,并构建了一组视频聊天扩展,称为 Jingle (也是开源的)
Take a look at Jabber (XMPP) - which is designed specifically for the tasks you describe. Jabber-net is a helpful .NET library. FYI Google IM using Jabber and has built a set of video chat extensions known as Jingle (also open-sourced)
这里的级别非常高:
对于语音聊天,我将使用 direct x 的麦克风音频驱动程序来捕获语音数据,然后将其流式传输到另一台计算机(UDP 数据包,但使用 Beej 的 [http://beej.us/guide/bgnet/] 指南)
这是一个很棒的教程和代码,可以帮助您开始:
http://www.codeproject.com/KB/audio- video/VoiceChatApplicationInCS.aspx?msg=2193667
这与网络摄像头的想法类似,只不过您不是发送音频数据,而是传输一系列图像。 Direct X SDK 中应该为此提供一个库(直接显示?),它将为一堆网络摄像头提供通用 API,但在数据末尾,您将从中获取数据一台计算机,使用音频和视频格式对其进行编码、流式传输和解码。
祝你好运!
Very high level here:
For voice chat, I would go about using direct x's audio drivers for microphones to capture the voice data then stream it to the other computer (UDP packets, but do an overview of networking using Beej's [http://beej.us/guide/bgnet/] guide)
This is a great tutorial and code to get you started:
http://www.codeproject.com/KB/audio-video/VoiceChatApplicationInCS.aspx?msg=2193667
It's a similar idea with the webcam except instead of sending audio data you'd be streaming a series of images. There should be a library in the Direct X SDK for this (direct show?) that will provide a generalized api for a bunch of webcams, but at the end of the data you'll be getting data from one computer, encoding, streaming and decoding it with both audio and video formatting.
Good luck!
如果您想使用 C# 中的原始套接字编写自己的协议,您需要熟悉网络协议。
首先了解如何向端口发送文本消息以及如何读取端口上发送的任何内容并将其显示到屏幕上。
您需要有一个简单的控制台应用程序,可以在端口上无限地侦听(充当您的服务器)
另一个简单的控制台应用程序将向您指定的端口发送消息,
这将为您提供一些开始的信息。然后你可以改变你的视频流代码(更难)
you want to be familiar with your networking protocols if you want to write your own protocol using raw sockets in C#.
start by looking up how to send a text message to a port and how to read anything sent on a port and display it to the screen.
you'll need to have a simple console app that runs infinitely listening on a port (acting as your server)
and another simple console app that will send messages to your specified port
that should give you something to start with. then you can alter your code for video streaming(alot harder)