Music Player using java netbeans mp4 YouTube
Music Player using java netbeans mp4 YouTube - смотрите и не говорите потом что мы вам это не показали. the sound function/method:---------------------- or for file
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.swing.JOptionPane;
import sun.audio.AudioPlayer;
import sun.audio.AudioStream;
public void sound{
AudioStream BGM;
try{
InputStream test = new FileInputStream".;
BGM = new AudioStreamtest;
AudioPlayer.player.startBGM;
}catchIOException error{
JOptionPane.showMessageDialognull, error.getMessage;
}
}
Now just call the function by placing the name of the song as parameter....
the sound function/method:---------------------- or for file ( ) import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import javax.swing.JOptionPane; import sun.audio.AudioPlayer; import sun.audio.AudioStream; public void sound(){ AudioStream BGM; try{ InputStream test = new FileInputStream("./never say.wav"); BGM = new AudioStream(test); AudioPlayer.player.start(BGM); }catch(IOException error){ JOptionPane.showMessageDialog(null, error.getMessage()); } } Now just call the function by placing the name of the song as parameter....