我想做的很清楚,只需播放一个声音并暂停它。问题是我不能暂停音乐。我找不到错误;我做错什么了?
public class MainC extends JFrame implements ActionListener {
int Copened,Cplay,Cstop,Csave,Cpause;
AudioStream aStream;
String Filename;
File file;
FileInputStream fis;
public MainC() {
Filename="";
txtname=new JTextField();
chooser=new JFileChooser();
}
public void actionPerformed(ActionEvent e) {
if(e.getSource()==btnopen){
chooser.showOpenDialog(this);
file=chooser.getSelectedFile();
}
if(e.getSource()==btnPause){
AudioPlayer.player.stop(fis);
}
if(e.getSource()==btnplay){
fis=new FileInputStream(file);
aStream=new AudioStream(fis);
AudioPlayer.player.start(aStream);
暂无答案!
目前还没有任何答案,快来回答吧!