简体   繁体   English

.NET视频音频聊天

[英].NET Video Audio Chat

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. 到目前为止,我已经在C#中开发了BattleShips的点对点游戏,并在Java中开发了Connect 4的点对点游戏。

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#. 我想在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. 我已阅读SO和其他各种来源,但由于我缺乏经验,它仍然被证明是神秘的。

any tips at a newbie level are most welcome ie looking for relatively easy to understand tutorials. 任何新手级别的提示都是最受欢迎的,即寻找相对容易理解的教程。

Take a look at Jabber (XMPP) - which is designed specifically for the tasks you describe. 看看Jabber(XMPP) - 它是专门为您描述的任务而设计的。 Jabber-net is a helpful .NET library. Jabber-net是一个有用的.NET库。 FYI Google IM using Jabber and has built a set of video chat extensions known as Jingle (also open-sourced) 仅供参考使用Jabber的谷歌IM,并建立了一套名为Jingle的视频聊天扩展(也是开源的)

you want to be familiar with your networking protocols if you want to write your own protocol using raw sockets in C#. 如果要在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) 然后你可以改变视频流的代码(很难)

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) 对于语音聊天,我会使用直接x的麦克风音频驱动程序捕获语音数据,然后将其传输到另一台计算机(UDP数据包,但使用Beej的网络概述[ http://beej.us/guide/ bgnet /]指南)

This is a great tutorial and code to get you started: http://www.codeproject.com/KB/audio-video/VoiceChatApplicationInCS.aspx?msg=2193667 这是一个很棒的教程和代码,可以帮助您入门: 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. Direct X SDK中应该有一个库(直接显示?),它将为一堆网络摄像头提供一个通用的api,但是在数据的最后你将从一台计算机获取数据,编码,流媒体和用音频和视频格式解码它。

Good luck! 祝好运!

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

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