I have an app that plays some mp3 files with NAudio and I spent a few days trying to send this soun开发者_开发问答d over network to another pc, but I'm lost about what's the better way to do that. What classes I need to use to access the buffer and how to re-build that byte array to be played in remote? What is best, send mp3Frames, or it could be better to send raw or pcm data?
I'm really lost, any help would be appreciated. Thanks
I would recommend transmitting across the network as MP3, not PCM as the PCM files are a lot larger than the MP3.
The latest NAudio source code includes a demo (in the NAudioDemo project) of playing internet MP3 radio which will show you how to receive MP3 frames, decompress them, and put them into a BufferedWaveProvider for playback. I've written an article about how this works on my blog.
NAudioDemo also includes a demo of network peer to peer audio chat, sending the audio using UDP sockets, although MP3 isn't used for the compression.
精彩评论