I expect the sound is out of order because you are using UDP which does not
enforce packet ordering like TCP. The fix is to either use TCP or create
your own ordering scheme. If you do that, you will also need to handle
dropped packets as UDP doesn't guarantee delivery either. If you add too
much overhead to UDP, you can easily make it perform worse then TCP, so
that's something you need to test. Good luck!
Mike
----- Original Message -----
From: "Norman Maurer" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, July 09, 2007 8:39 AM
Subject: Writing a Server to stream mp3 via UDP
Hi all,
we bought some device which recieve mp3 streams via udp (raw) as a
prototype. Now we want to build an app which streams some raw udp data to
this device.
I wrote some quick code with mina. The good news is that it play some
sound, the bad is that the sound seems to stuck and is not in the right
order.
I tried to use StreamWriteFilter to write directly the given InputStream.
I think I need to suspend the write when the buffer of the device is full.
But how can i detect this ?
Any idea ?
The second problem which is that I have no idea howto calculate the paket
sizes which i need to use for the various mp3 bitrates.
Any help is welcome :-)
bye
Norman