MP3 formats

I have used audiokonverter (as a menu option on Dolphin) to convert flac files to mp3. I used bit rate of 128. The converted files play well in MPlayer (but no in Kaffeine) but when I try to play them through a java program (using MP3SPI and JLayer) I get an error claiming an unsupported audio format.

Is MP3 a single format? or are there several different MP3 formats? How can I get a format that does play using MP3SPI? Should I use a different bit rate or a different converter?

Thanks,

Abe

Why don’t you try converting with a different application
jripper will do it (it’s in packman)

Thanks - will try. I simply don’t know which ripping package will create which mp3 format. I wish there was some guide to these subtleties somewhere.

Abe

I don’t think there’s something like different .mp3 formats. .mp3 is not a container, but MPEG-2 Audio Layer III, period.

What does ‘file’ say about the respective data?

The command:
> file mp3/Aaron\ T-Bone\ Walker/Stormy\ Monday\ Blues/Track1.mp3

gives:
> mp3/Aaron T-Bone Walker/Stormy Monday Blues/Track1.mp3: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo

Thanks,

Abe

That is a pretty regular output. I suppose the problem is not the file, but the application. What’s the exact error message?

Kaffeine might use extra-codecs (libxine1-codecs from Packman) to play it.

The error I get is:
javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file

Could the problem be related to the bit rate I chose during encoding? I was offered many different values by audiokonverter and chose 128 bit. I also chose to keep stereo (if possible) - which was the only other question I was asked.

Thanks,

Abe

Is that the full output?

I’m not even sure the Java API supports any audio data besides .wav .au and .aiff. Did you try to play other .mp3s with it yet? I suppose they won’t work either.

Edit: Just found →this.

JavaSE, via Java Sound API (in packages javax.sound), supports two types of audio:

* Sampled Audio: Sampled audio is represented as a sequence of time-sampled data of the amplitude of sound wave. It is supported in package javax.sound.sampled. The supported file formats are: "wav", "au" and "aiff". The samples can be either 8-bit or 16-bit, with sampling rate from 8 kHz to 48 kHz.
* Musical Instrument Digital Interface (MIDI): MIDI music is synthesized from musical notes and special sound effects, instead of time-sampled, like a recipe for creating musical sound. MIDI is supported in package javax.sound.midi.

Java Sound API also include a software sound mixer that supports up to 64 channels for sound effect and background music.

Java Media Framework (JMF), which is not part of JavaSE, is needed to support MP3 and advanced features. JOAL (Java Bindings on OpenAL) supports 3D sound effect.

This is not, and should not be, a java question. I am using MP3SPI which extends java to play MP3 files and is supposed to be a robust solution used by many people. If I have to take a bet on which is wrong - MP3SPI or my encoded file, I think it is probably the latter.

And yes - the output I get is the full output. It seems quite clear, but there is always the possibility that the error message does not match the actual error.

Thanks,

Abe

If you search on “javax.sound.sampled.UnsupportedAudioFileException mp3” you will find that it appears to be a Java API limitation.

MP3 playback using Java Sound and Sun MP3 plugin

If the MP3 file plays on everything else, then the suspicion falls on the Java API.

Thanks, this is always a possibility. I will investigate in this direction (the link you give is one I have seen before), but from what I read about MP3SPI it is supposed to work without JMF. Anyway, if this is indeed a java problem it does not belong in this forum.

Thanks again,

Abe

Why don’t you test the file then? Did you try other players? Did you run any diagnostic tools on the .mp3 (for example ‘mp3_check’ or ‘mp3diags’)?