posted 22 years ago
Hi Priya,
Are you sure that your buffer size on the server is large enough to accommodate what the client is sending? DatagramSocket.receive() will silently truncate the received bytes if the buffer is not larger enough. Also, sound samples are usually pretty big. Are you trying to send several seconds worth at a time or are you framing it up and sending multiple packets? If you are sending multiple packets, you need some method of tagging their position since the UDP protocol does not guarantee that packets will be delivered in order or even that they will all be delivered. So for a basic streaming audio system, you really need a framing class on the client and an assembling class on the server. You also need some means for the server to request a resend for any missing or corrupted packets.
Hope this is helpful,
Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher