Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > MP3 playback using Java Sound and Sun MP3 plugin

Reply
Thread Tools

MP3 playback using Java Sound and Sun MP3 plugin

 
 
Daniel Dyer
Guest
Posts: n/a
 
      01-21-2006
I downloaded Sun's plugin for MP3 support
(http://java.sun.com/products/java-me...download.html). The
website seems to suggest that it will work with the Java Sound APIs
without any need to install the Java Media Framework. However, I can only
get it to work with the Java Sound classes when the JMF is also installed
(I've tried on Windows and Linux).

Has anybody managed to get it to work without installing the JMF?

I'm aware that I can use the MP3SPI/JLayer libs from JavaZoom, but I'd
like to get it working with Sun's stuff if possible (performance and
licensing being the main reasons). Does anyone know of any other pure
Java MP3 player libraries?

Thanks,

Dan.

--
Daniel Dyer
http://www.dandyer.co.uk
 
Reply With Quote
 
 
 
 
Daniel Dyer
Guest
Posts: n/a
 
      01-21-2006
On Sat, 21 Jan 2006 21:30:57 -0000, Daniel Dyer
<(E-Mail Removed)> wrote:

> I downloaded Sun's plugin for MP3 support
> (http://java.sun.com/products/java-me...download.html). The
> website seems to suggest that it will work with the Java Sound APIs
> without any need to install the Java Media Framework. However, I can
> only get it to work with the Java Sound classes when the JMF is also
> installed (I've tried on Windows and Linux).
>
> Has anybody managed to get it to work without installing the JMF?


I should probably specify the error I'm seeing. I get the following
exception when I call the getAudioInputStream method of the
javax.sound.sampled.AudioSystem class and pass it an MP3 file:

javax.sound.sampled.UnsupportedAudioFileException: could not get audio
input stream from input file
at
javax.sound.sampled.AudioSystem.getAudioInputStrea m(AudioSystem.java:1170)

Dan.

--
Daniel Dyer
http://www.dandyer.co.uk
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      01-21-2006
On Sat, 21 Jan 2006 21:30:57 -0000, "Daniel Dyer"
<(E-Mail Removed)> wrote, quoted or indirectly
quoted someone who said :

>
>Has anybody managed to get it to work without installing the JMF?


It is part of JMF, just a Johnny come lately part as I understand it.

See http://mindprod.com/jgloss/jmf.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Reply With Quote
 
Daniel Dyer
Guest
Posts: n/a
 
      01-21-2006
On Sat, 21 Jan 2006 22:56:08 -0000, Roedy Green
<(E-Mail Removed) > wrote:

> On Sat, 21 Jan 2006 21:30:57 -0000, "Daniel Dyer"
> <(E-Mail Removed)> wrote, quoted or indirectly
> quoted someone who said :
>
>>
>> Has anybody managed to get it to work without installing the JMF?

>
> It is part of JMF, just a Johnny come lately part as I understand it.
>
> See http://mindprod.com/jgloss/jmf.html


The download page says:

"The included jar file (mp3plugin.jar) contains a Java Sound plugin as
well as a Java Media Framework plugin for playing MPEG-2 Layer 3 Audio."

....and then goes on to describe two installation steps, one to get it to
work with Java Sound and an additional step to get it to work with the
JMF. I'm not using any of the JMF classes directly, I'm just using
javax.sound.sampled.* rather than javax.media.*, but it only seems to work
if the JMF is installed. I would expect a ClassDefNotFoundError or
similar, rather than the UnsupportedAudioFileException that I am getting,
if it was reliant on the JMF classes.

Dan.

--
Daniel Dyer
http://www.dandyer.co.uk
 
Reply With Quote
 
Knute Johnson
Guest
Posts: n/a
 
      01-22-2006
Daniel Dyer wrote:
> On Sat, 21 Jan 2006 22:56:08 -0000, Roedy Green
> <(E-Mail Removed) > wrote:
>
>> On Sat, 21 Jan 2006 21:30:57 -0000, "Daniel Dyer"
>> <(E-Mail Removed)> wrote, quoted or indirectly
>> quoted someone who said :
>>
>>>
>>> Has anybody managed to get it to work without installing the JMF?

>>
>>
>> It is part of JMF, just a Johnny come lately part as I understand it.
>>
>> See http://mindprod.com/jgloss/jmf.html

>
>
> The download page says:
>
> "The included jar file (mp3plugin.jar) contains a Java Sound plugin as
> well as a Java Media Framework plugin for playing MPEG-2 Layer 3 Audio."
>
> ...and then goes on to describe two installation steps, one to get it
> to work with Java Sound and an additional step to get it to work with
> the JMF. I'm not using any of the JMF classes directly, I'm just
> using javax.sound.sampled.* rather than javax.media.*, but it only
> seems to work if the JMF is installed. I would expect a
> ClassDefNotFoundError or similar, rather than the
> UnsupportedAudioFileException that I am getting, if it was reliant on
> the JMF classes.
>
> Dan.
>


Daniel:

I ran into the same problems that you have seen. The MP3 plugin will
work with JavaSound but it only works with certain format MP3 files.
Apparently (and I am not that knowledgable in this area) there are many
different types of MP3 files. JMF will apparently play more different
file types.

There is a really good JavaSound email list

http://java.sun.com/products/java-media/sound/list.html

and you should look into Tritonus. These fellows have written some
really handy things, MP3 too, for JavaSound.

www.tritonus.org

One of the guys on the list was the Sun guy for JavaSound for a couple
of years and is really knowledgable and very helpful.

--

Knute Johnson
email s/nospam/knute/
 
Reply With Quote
 
Daniel Dyer
Guest
Posts: n/a
 
      01-22-2006
On Sun, 22 Jan 2006 02:10:32 -0000, Knute Johnson
<(E-Mail Removed)> wrote:
> I ran into the same problems that you have seen. The MP3 plugin will
> work with JavaSound but it only works with certain format MP3 files.
> Apparently (and I am not that knowledgable in this area) there are many
> different types of MP3 files. JMF will apparently play more different
> file types.
>
> There is a really good JavaSound email list
>
> http://java.sun.com/products/java-media/sound/list.html


Thanks, I will take a look.

> and you should look into Tritonus. These fellows have written some
> really handy things, MP3 too, for JavaSound.
>
> www.tritonus.org


I was looking at the Tritonus stuff, but I wasn't sure exactly what it
was. It seems to be a pure Java implementation of Java Sound that was
written primarily for Linux. Is that correct?

I know the MP3SPI library uses it. I hacked around in the source code to
try and remove the dependency and see if MP3SPI would work just using the
base Java Sound classes, but I didn't get it to work properly.

There's no reason why I can't use Tritonus (or why I can't install JMF), I
just thought it should be possible to play MP3s without either.

Thanks,

Dan.



--
Daniel Dyer
http://www.dandyer.co.uk
 
Reply With Quote
 
Knute Johnson
Guest
Posts: n/a
 
      01-22-2006
Daniel Dyer wrote:
> I was looking at the Tritonus stuff, but I wasn't sure exactly what it
> was. It seems to be a pure Java implementation of Java Sound that was
> written primarily for Linux. Is that correct?


I think you are right, they are primarily Linux guys, but Tritonus will
run just fine on any Java system.

> I know the MP3SPI library uses it. I hacked around in the source code
> to try and remove the dependency and see if MP3SPI would work just
> using the base Java Sound classes, but I didn't get it to work properly.
>
> There's no reason why I can't use Tritonus (or why I can't install JMF),
> I just thought it should be possible to play MP3s without either.


The nice thing about the Tritonus is that it is just a couple of JAR
files any you are ready to go. Ask around on the JAVASOUND mailling
list, I'm sure they can get you running with the plugin. I just didn't
get where I was going with it and moved on to something else. I'm sure
it will work.

--

Knute Johnson
email s/nospam/knute/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clicking on Sun Java Plugin installation evokes 3 basic java setup questions Bonnie Johnson Java 2 01-10-2007 10:13 AM
Sun Updates Sun Java Availability Suite, Adds Sun Cluster Advanced Edition for Oracle Real Application Clusters Deployments technology_post@yahoo.com Java 0 04-05-2006 04:29 AM
Detect if Sun plugin is installed (in IE) EVEN if not set as default in plugin? PilotYid Java 1 10-31-2005 11:13 AM
Force java applet to run on java microsoft virtual machine plugin and not Sun. emaxt6@yahoo.com Java 4 05-09-2005 03:54 PM
Diff of Sun Java System AppServer vs. SunONE Server vs. Sun Java System Web Server ? Ulf Meinhardt Java 0 11-11-2004 09:40 PM



Advertisments