tags:

views:

2629

answers:

3

Is it possible to stream mp3s using pure Java? If so, what are the best resources to implement this.

If not, are any other music formats streamable using Java only?

A: 

I think you can use the Java Media Framework from SUN to achieve what you want. Being this the official SUN implementation this would be the way to go. I am pretty sure that the actual streaming is native though.

I looked in the FAQ and I found the following answer:

Q: Will JMF 2.1.1 support streaming?

Yes. JMF 2.1.1 provides RTP/RTSP streaming support.

JMF 2.1.1 also provides HTTP and FTP streaming support on the client side.

Mario Ortegón
+2  A: 

As Mario says, JMF - Java Media Framework is a good starting point.

What Mario does not say is that Sun killed MP3 support since 2.1.1b as detailed in the "My Lost Streaming MP3 Article" blog entry.

So you need to add a plugin to support MP3:
the JMF Formats list does mention MP3 (under the ACM -- Window's Audio Compression Manager support -- section), but only for Windows, and not with JMF alone.

VonC
A: 

You could use MP3SPI from JavaZoom to stream MP3 files

As it says on their webpage: "MP3SPI is a Java Service Provider Interface that adds MP3 (MPEG 1/2/2.5 Layer 1/2/3) audio format support for Java Platform. It supports streaming, ID3v2 frames, Equalizer, .... "

People have already used it to build applicatons that stream from Shoutcast


Hope this helps

Sandman