Quantcast
Channel: GUJ - Tópicos com a tag java
Viewing all articles
Browse latest Browse all 17410

Como reproduzir duas musicas consecutivas em java ?

$
0
0

@Morpheus_craft escreveu:

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

Mensagens: 1

Participantes: 1

Ler tópico completo


Viewing all articles
Browse latest Browse all 17410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>