Create a live audio stream from a string in a device for HTML5

I use NAudio to capture the audio signal from my string in the device into an array of bytes. I can successfully send this byte array through my WLAN via UDP broadcast and receive it on another computer. Once the byte array has been received, I can play the audio stream.

My goal is to transmit an audio signal from a string on a device so that it can be used with an HTML5 tag or jPlayer . Do you have an example or reading material on how to convert an input byte array to a stream as a compatible HTML5 format?

I would like to create a .NET solution without using third-party applications.

Here is an example of how I capture and transmit audio over UDP.

var waveIn = new WaveInEvent();
waveIn.DeviceNumber = deviceID;
waveIn.WaveFormat = Program.WAVEFORMAT;
waveIn.BufferMilliseconds = 50;
waveIn.DataAvailable += OnDataAvailable;

var udpSender = new UdpClient();
udpSender.JoinMulticastGroup(Program.MulticastIP);

waveIn.StartRecording();

private void OnDataAvailable(object sender, WaveInEventArgs e)
{
    udpSender.Send(e.Buffer, e.BytesRecorded, Program.EndPoint);
}
+4
1

, , HTML5, .

W3Schools, (wav/ogg/mp3):

http://www.w3schools.com/html/html5_audio.asp

HTML5 audio . , .

HTML5 - . - . . .

, , - .Net P/Invoke libvlc, VLC Media Player.

StackOverflow , - libvlc:

libvlc mp3

#. P/Invoke, , .

0

All Articles