Ola galera, tenho um programa para reproduzir musicas
esse é o codigo:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
sound("System Of A Down - B.Y.O.B - 128K MP3");
} catch (IOException ex) {
Logger.getLogger(BotãoSom.class.getName()).log(Level.SEVERE, null, ex);
}
JOptionPane.showMessageDialog(null,"Gostou???");
try {
sound("System Of A Down - Toxicity - 128K MP3");
} catch (IOException ex) {
Logger.getLogger(BotãoSom.class.getName()).log(Level.SEVERE, null, ex);
}
JOptionPane.showMessageDialog(null,"Gostou???");
}
public void sound(String nm) throws IOException{
AudioStream BMG;
try{
InputStream test = new FileInputStream("./"+nm+".wav");
BMG = new AudioStream(test);
AudioPlayer.player.start(BMG);
}catch(IOException erro){
JOptionPane.showMessageDialog(null, erro.getMessage());
}
}
tenho que reproduzir duas musicas consecutivas, venho tentando mais não consigo.
gostaria de saber se alguem ja respondeu esse problema, que poderia me ajudar