key pressed plays mp3 file
              in 
             Core Library Questions 
              •  
              11 months ago    
            
 
           
             Hi. I am a humble n00bie to the world of processing and I am trying to write a simple program that plays an mp3 file when a key is pressed. No images. Just audio. I thought I could maybe do this using a key pressed () program combined with a CreateOutput() but that doesn't seem to work when I take away the drawing aspect of it. When this didn't work,  I looked into Minim and tried to adjust this: 
            
             
            
            
             
              
             
             
              
             
             
              
             
             
              
             
             
               
             
             
            
             
            
            
             
            
            
             
            
            
 
            
           
              import ddf.minim.*;
             
             
              import ddf.minim.signals.*;
             
             
              import ddf.minim.analysis.*;
             
             
              import ddf.minim.effects.*;
             
             
              Minim loader;
             
             
              AudioPlayer player;
             
             
              //audio player
             
             
              createOutput(Homealone);
             
             
              loader = new Documents.Homealone.mp3;
             
             
              player = loader.loadFile("Homealone.mp3");
             
             
              player.loop();
             
             
               if (keyPressed == true){
             
             
                  //plays the sound effect "Homealone"
             
             
               player = loader.loadFile("Homealone.mp3");
             
             
               player.play();
             
             
               }
             
            
             I don't think the codes I have used are adjusted correctly....
            
            
             Any ideas on how to do this would of GREAT GREAT HELP!
            
            
             THANK YOU!!!!!!!!!!!!!!
            
 
            
              
              1  
            
 
            
 
 
           
 
             
              
             