MediaPlayer works with most of the files, except when there's some characters in the filename.
MediaException: MEDIA_UNAVAILABLE : T:\Music\Paradis - Hémisph?re.m4a (The system cannot find the file specified)
public static void play(File song) {
// Checks if file exists
if (!song.exists()) {
System.out.println("Song doesn't exist! " + song.getAbsolutePath());
return;
}
Media media = new Media(song.toURI().toString());
player = new MediaPlayer(media);
player.play();
}
And the code calling the function:
FXMediaPlayer.play(new File("T:\\Music\\Paradis - Hémisphère.m4a"));
Some of the characters are: é ê ä
How should i correctly parse the filename or is it something wrong with MediaPlayer?