Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   MP3 playback using Java Sound and Sun MP3 plugin (http://www.velocityreviews.com/forums/t149533-mp3-playback-using-java-sound-and-sun-mp3-plugin.html)

Daniel Dyer 01-21-2006 09:30 PM

MP3 playback using Java Sound and Sun MP3 plugin
 
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

Daniel Dyer 01-21-2006 09:59 PM

Re: MP3 playback using Java Sound and Sun MP3 plugin
 
On Sat, 21 Jan 2006 21:30:57 -0000, Daniel Dyer
<dan@dannospamformepleasedyer.co.uk> 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

Roedy Green 01-21-2006 10:56 PM

Re: MP3 playback using Java Sound and Sun MP3 plugin
 
On Sat, 21 Jan 2006 21:30:57 -0000, "Daniel Dyer"
<dan@dannospamformepleasedyer.co.uk> 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.

Daniel Dyer 01-21-2006 11:15 PM

Re: MP3 playback using Java Sound and Sun MP3 plugin
 
On Sat, 21 Jan 2006 22:56:08 -0000, Roedy Green
<my_email_is_posted_on_my_website@munged.invalid > wrote:

> On Sat, 21 Jan 2006 21:30:57 -0000, "Daniel Dyer"
> <dan@dannospamformepleasedyer.co.uk> 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

Knute Johnson 01-22-2006 02:10 AM

Re: MP3 playback using Java Sound and Sun MP3 plugin
 
Daniel Dyer wrote:
> On Sat, 21 Jan 2006 22:56:08 -0000, Roedy Green
> <my_email_is_posted_on_my_website@munged.invalid > wrote:
>
>> On Sat, 21 Jan 2006 21:30:57 -0000, "Daniel Dyer"
>> <dan@dannospamformepleasedyer.co.uk> 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/

Daniel Dyer 01-22-2006 11:55 AM

Re: MP3 playback using Java Sound and Sun MP3 plugin
 
On Sun, 22 Jan 2006 02:10:32 -0000, Knute Johnson
<nospam@ljr-2.frazmtn.com> 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

Knute Johnson 01-22-2006 05:43 PM

Re: MP3 playback using Java Sound and Sun MP3 plugin
 
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/


All times are GMT. The time now is 12:44 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.