Vote count:
0
I was trying simple method to open an audio file while trying to run the program Users\Amaan\Music\Eminem - Love The Way You Lie.mp3 (The system cannot find the specified path)(in java.io.FileInputStream) is coming
P.s. - I am running Java with administrator privileges.
The program is
import java.io.*;
import sun.audio.*;
public class PlaySoundDemo
{
public static void main(String[] args)throws Exception
{
// open the sound file as a Java input stream
String gongFile = "Users\\Amaan\\Music\\Eminem - Love The Way You Lie.mp3";
InputStream in = new FileInputStream(gongFile);
// create an audiostream from the inputstream
AudioStream audioStream = new AudioStream(in);
// play the audio clip with the audioplayer class
AudioPlayer.player.start(audioStream);
}
}
asked 1 min ago
The system cannot find the specified path in Java while opening music file
Aucun commentaire:
Enregistrer un commentaire