I have a problem with playing more than 2 sound files in a game I m developing now in j2me MIDP2 in eclipse. Please advice me the best way for playing multiple "wav" sound files. I created the following method that is called once when the program starts
public void setSound()
{
System.out.println("Sound on");
try {
p1=Manager.createPlayer(is1, "audio/X-wav");
p2=Manager.createPlayer(is2, "audio/X-wav");
p3=Manager.createPlayer(is3, "audio/X-wav");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (MediaException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
我每次都需要打响声音之一,就停止其他两个角色(确保其中任何一方都不会运行p2.stop(); p3.stop();
并开始第三者(p1.start(
);,每次我有两名参与者(在PREFETCHED国家里)停职,第三人没有工作,有例外。