我想创建一个可以播放shoutcast无线电的java程序。我从javazoom开始,但它显示有关无效http的错误。此外,我下载jlGui(来自同一网站),它与我创建的程序有相同的问题。最后我尝试了很多广播电台,但我遇到了同样的问题。如果有人知道另一种方式或一些java库我会欣赏它!感谢名单
import javazoom.jlgui.basicplayer.BasicController;
import javazoom.jlgui.basicplayer.BasicPlayer;
import javazoom.jlgui.basicplayer.BasicPlayerEvent;
import javazoom.jlgui.basicplayer.BasicPlayerException;
import javazoom.jlgui.basicplayer.BasicPlayerListener;
try {
player = new BasicPlayer();
playerControl = (BasicController) player;
player.addBasicPlayerListener(this);
try {
playerControl.open(new URL(streamurl));
} catch (MalformedURLException ex) {
System.out.println("aaa");
}
playerControl.play();
playerControl.setGain(0.85);
playerControl.setPan(0.0);
} catch (BasicPlayerException ex) {
System.out.println(ex);
}
错误消息
javazoom.jlgui.basicplayer.BasicPlayerException:
java.io.IOException: Invalid Http response
答案 0 :(得分:0)
你必须设置javaSE 1.6而不是1.7!