小弟用import javax.media.*;
import java.net.URL;
public class Play implements ControllerListener {
private Player player;
boolean first = true, loop = false;
public Play(String fanme) {
try { 
player = Manager.createPlayer (new URL("file:/"+fanme));
System.out.println(player.getClass());
player.addControllerListener (this);
player.start();
} catch (java.io.IOException e2) {
System.out.println (e2); return;
} catch (NoPlayerException e2) {
System.out.println ("不能找到播放器.");
return;
}
if (player == null) {
System.out.println ("无法创建播放器.");
return;
}
}
public void controllerUpdate (ControllerEvent event) {
System.out.println("It is Update...");
if (event instanceof javax.media.EndOfMediaEvent) {
player.setMediaTime(new Time(0));
player.start();
}
if (event instanceof javax.media.RealizeCompleteEvent) {
System.out.println("Realized!");
}
}
public static void main(String[] abc) {
new Play("...............");//声音位置 
}
}的简易方法去播放音频文件,
发现只能播放.MP3
.WAV,.MP2,.AU,.MID全部不能出声求教~~~洒泪跪求解释