Note that there are some explanatory texts on larger screens.

plurals
  1. POLineUnavailableException for playing mp3 with java
    primarykey
    data
    text
    <p>My goal is to play an mp3 file from Java. With every approach that I took, it always fails with a <code>LineUnavailableException</code>.</p> <pre><code> AudioInputStream inputStream = AudioSystem.getAudioInputStream(new URL("http://localhost:8080/agriserver/facebook/sound/test6.mp3")); Clip clip = AudioSystem.getClip(info); clip.open(inputStream); clip.start(); </code></pre> <p>Failed attempts to fix it:</p> <ul> <li>Use Sun's mp3 plugin.</li> <li>Use Jlayer 3rd party library</li> <li>Use Tritonus 3rd party library</li> <li>Re-encode the mp3 with Sony Sound Forge, Adobe Sound Booth, all no luck</li> <li>Re-encode the mp3 with different encode rates and sampling rates</li> <li>Try to use JMF</li> <li>Use random mp3 from the Internet that plays fine in other applications</li> <li>Read postings with the same error. None of the postings have an answer that helped resolve the issue.</li> </ul> <p>Here is the exception:</p> <pre> Exception in thread "main" javax.sound.sampled.LineUnavailableException: line with format MPEG1L3 48000.0 Hz, unknown bits per sample, stereo, unknown frame size, 41.666668 frames/second, not supported. at com.sun.media.sound.DirectAudioDevice$DirectDL.implOpen(DirectAudioDevice.java:494) at com.sun.media.sound.DirectAudioDevice$DirectClip.implOpen(DirectAudioDevice.java:1280) at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:107) at com.sun.media.sound.DirectAudioDevice$DirectClip.open(DirectAudioDevice.java:1061) at com.sun.media.sound.DirectAudioDevice$DirectClip.open(DirectAudioDevice.java:1151) at Demo.playMp3(Demo.java:83) </pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload