You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Elliot Huntington <el...@gmail.com> on 2015/08/19 07:18:03 UTC

How to play an mp3 in felix

I am experimenting with an OSGi application using Felix. I wrote a very
simple application that plays an MP3 file (using
com.googlecode.soundlibs:mp3spi). This application works fine in standalone
mode in the JVM.

I used bnd to wrap the mp3spi jar and then tested the application in Felix
and got this error:

javax.sound.sampled.UnsupportedAudioFileException: could not get audio
input stream from input stream
    at
javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1121)

After some googling I found the reason for this is because the JVM's SPI
mechanism does not play well in an OSGi environment. This makes sense. I
found the Apache Aries SPI Fly project (
http://aries.apache.org/modules/spi-fly.html#releases) but I have not been
able to get this working successfully for my simple test application.

I'm just curious if anybody has a simple example, hopefully on github, of
how to play an MP3 file in Felix, or any OSGi container for that matter.

Thanks,
Elliot