C#基于UDP实现的P2P语音聊天工具

2019-12-30 10:57:56王冬梅
  • if (stoppedEventArgs.Exception != null)   {  
  • MessageBox.Show(stoppedEventArgs.Exception.Message);   }  
  • if (wavePlayer != null)   {  
  • wavePlayer.Stop();   }  
  • btn_luyin.Enabled = true;   }private void btn_play_Click(object sender, EventArgs e)  
  • {   btn_luyin.Enabled = false;  
  • play_sound(soundfile);   } 

    C#基于UDP实现的P2P语音聊天工具

    C#基于UDP实现的P2P语音聊天工具

    在上面演示了接收和发送一段语音消息的界面

    技术总结

    主要用到的技术就是UDP和NAudio的录音和播放功能

    希望这篇文章能够给大家提供一个思路,帮助大家实现P2P语音聊天工具。