Hi there,
I'm finding it incredibly difficult to implement mp3 support/playback into the software i'm working on. I'm coding the software in IDEA IntelliJ and my software already supports audio playback (16bit). There is code which converts from byte code to shorts (or floats or whatever you want) for processing, then back to byte code for playback.
I was under the impression that if i use MP3SPI, i will simply be able to use the existing code, but if i add it to my classpath (along with jlayer and tritonus_share), it doesn't seem to work. I actually use IntelliJ to import the jars as dependancies for the audio module. That should take care of everything, right?
Currently, if i try to do: "audioInputStream = AudioSystem.getAudioInputStream(file);" on an MP3 file, i get an UnsupportedAudioFileException:
javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file
at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1170)
at audio.input.LoadMP3.createAudioInputStream(LoadMP3.java:247)
at audio.input.LoadMP3Panel.init(LoadMP3Panel.java:88)
I was under the impression that if i simply add the 3 jar's to the 'dependencies' for that module in IntelliJ, it should utilize them and allow me to use 'normal'
java sound code to read the mp3's... but i guess not? I was using this article as a guide, but documentation in general seems scarce:
http://onjava.com/pub/a/onjava/2004/08/11/javasound-mp3.html?page=2
If anyone has any advice on getting mp3 support working, i'd appreciate that. I thought it would be simple - what am i doing wrong? The Javazoom forums are not working so i can't ask there. I have the following files in my lib directory:
- jl1.0.1.jar
- mp3spi1.9.5.jar
- tritonus_share
- tritonus_aos
Thanks,
Eddie