简体   繁体   中英

JavaFX 2.0 AudioClip doesn't play in applets?

Okay,so I made a small game in JavaFX 2.0, and I have a player shot sound which plays each time the player shoots. Works great on desktop, but doesn't play on applet.

I was wondering if anyone could tell me why the shot sound doesn't play in the applet?

Here is the directory with the game. galaxy.html is used to play the applet. click here to go to game directory

And here is the code to load the audioclip:

playerShot = new AudioClip(Galaxy.class.getClassLoader().getResource("playershot.mp3").toString());

There is an issue with short MP3 audio In JavaFX 2.0.1. A workaround is to convert it to WAV or AIFF. For viewing the issue see http://javafx-jira.kenai.com/browse/RT-13945 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM