How to stream mp3 using pure Java

17,299

Solution 1

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.

Solution 2

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

Share:
17,299
npellow
Author by

npellow

Updated on July 20, 2022

Comments

  • npellow
    npellow almost 2 years

    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?