0

I´m trying to simply play background musik using sun.audio. However for some reason, I´m not able to import it. I tried the following lines

import sun.audio.AudioPlayer;
import sun.audio.*;

and both times it sais "The import sun.audio cannot be resolved". I also tried just starting to write code with it, as eclipse then proposes quick fixes, including imports. But that also did not work out. I would really appreciate it, if someone could help me out with this.

mousekip
  • 117
  • 10
  • Sun packages may have been cleaned out in modern versions of java and you may need to bring them yourself. – Thorbjørn Ravn Andersen Jan 02 '21 at 03:23
  • @ThorbjørnRavnAndersen and how do I do that? Do I have to download some kind of repair software or would it be best to use other ways of implementing sounds? – mousekip Jan 02 '21 at 03:34
  • I don't believe it is downloadable. According to https://stackoverflow.com/questions/22031701/sun-audio-player-and-sound-i-o, the solution is to recode your application to use the `javax.sound` APIs. (The `sun.sound` APIs were removed in Java 9.) – Stephen C Jan 02 '21 at 03:38
  • Ok I´ll try using that instead. Thank´s a lot – mousekip Jan 02 '21 at 03:40

0 Answers0