2
votes

I have a two-way audio chat written in C#. Means: There is a server application, that sends wave-encoded audio as a byte array over UDP. The client-application then decodes and plays the audio. So this works fine. For recording and encoding/ decoding, I use NAudio (library).

Now, the task is a different one, to display the stream on a website. I would prefer to use ASP.NET, so I can receive and decode the string with C# and NAudio. I display a cam image there as well, which works smoothly and without any problem.

Still I don't know how to do this. Can the UDP-bytestream just be decoded and played? I don't think this is possible, or could javascript be used instead of C#? HTML5 audio tag could also be useful.

Would be very happy to receive answers.

1
As udp is connectionless, this means if your data doesnt get there, theres no way to know, or for the receiver no way to know it missed some, does this not interfere with the stream?BugFinder
This never interfered with voicechat... Of Course another protocol could be used, UDP is fast, but no absolutely required. It would be fine with TCP or whatever as well. The client listens to the port where the bytes arrive. But I don't know how to bring it to a page.yetanotheruser

1 Answers

0
votes

Since you mention you're using ASP.Net, it sounds like you already have a Microsoft server stack. You might look into Windows Media Services and see how you might be able to encode your audio/video into a WM stream and then embed that on your ASP.Net page.