I was wondering how to do that as well. I think that Joda Time may be a good library to incorporate for timing. It is also Apache licensed. http://joda-time.sourceforge.net/faq.html#performance
Cameron On 4/20/06, Luke Hubbard ([EMAIL PROTECTED]) <[EMAIL PROTECTED]> wrote: > Hi Trustin, > > Whats the best way of delaying the speed of writes. With red5 we need to > slow down to the bitrate of the stream. Currently we stream as fast as the > client can take it which isnt ideal. We are planning to add some code which > schedules a delay after we calculate the clients buffer is full. Is there a > mina way to do this? Delayed writes? Im just wondering how best to implement > this speed control. > > -- Luke > > On 4/20/06, Trustin Lee <[EMAIL PROTECTED]> wrote: > > > > On 4/20/06, Cameron Taggart <[EMAIL PROTECTED]> wrote: > > > > > > Anyone know or have a vague idea of how to create an MP3 stream so > > > that Winamp or iTunes or my SqueezeBox can connect to it? > > > > > > Do you have an MP3 file already? Then it is as easy as creating a server > > which writes out the mp3 files. All write operations are asynchronous in > > MINA, so you'll have to wait for each MPEG audio frame is sent out using > > WriteFuture.join() which is returned when you call IoSession.write(). To > > do > > this, you need to know the structure of a MPEG audio frame and how to > > calculate the duration of each frame in case the MP3 is VBR-encoded. > > > > I've been working on the SlimProto TCP Protocol, but it is pointless > > > if I don't have a MP3 stream for it to connect to. The protocol is > > > just used to control the the SqueezeBox and instruct it to connect to > > > a URL where it is supposed to find a MP3 steam, such as at > > > http://192.168.0.5:9000/stream.mp3. > > > > > > I'm used to the typical request and response in a web application. > > > How is a stream response different? > > > > > > There's a major difference in that streaming music is endless. This is > > absolutely the place non-blocking I/O has to kick in. Plus, you cannot > > stream data as fast as possible. You have to stream data with timing > > considering the client's buffer status. > > > > HTH, > > Trustin > > -- > > what we call human nature is actually human habit > > -- > > http://gleamynode.net/ > > -- > > PGP key fingerprints: > > * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E > > * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6 > > > > > >
