package test;

import java.applet.AudioClip;  
import java.net.MalformedURLException;  
import java.net.URL;  
import javax.swing.JApplet; 

public class test02 {
    public static void main(String[] args) {        
        PlayMusic p=new PlayMusic();  
        System.out.println("play");
        p.play();  
    }
    public static AudioClip loadSound(String filename) {  
        URL url = null;  
        try {  
            url = new URL("file:" + filename);  
        }   
        catch (MalformedURLException e) {;}  
        return JApplet.newAudioClip(url);  
    }  
    public void play() {  
        AudioClip christmas = loadSound("test/src/test/Boss_Fire.mp3");  
        christmas.play();  
    }
    
}

 

相关文章:

  • 2021-11-13
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2021-06-06
猜你喜欢
  • 2022-02-17
  • 2021-09-17
  • 2021-08-07
  • 2021-06-05
  • 2022-12-23
  • 2021-10-13
相关资源
相似解决方案