我试图运行在Java中使用此代码在谷歌应用程序引擎声音文件:GAE:javax.sound.sampled.AudioInputStream中不被谷歌App Engine的Java运行时环境支持
@UiHandler("btnRecite")
void btnRecite(ClickEvent event) throws Exception{
URL soundFile =new URL("http://everyayah.com/data/Ghamadi_40kbps/audhubillah.mp3");
AudioInputStream ais = AudioSystem.getAudioInputStream(soundFile);
AudioPlayer.player.start(ais);
}
我得到此异常
GAE:javax.sound.sampled.AudioInputStream is not supported by Google App Engine's Java runtime environment
任何想法可能是什么原因
感谢
我在客户端播放声音,我点击一个按钮添加此代码(编辑我的代码,这是错误张贴),如果你能指导我什么可能的解决方案,谢谢 – user1226162 2012-04-27 03:04:29
如果你想在客户端播放声音,那么你将需要使用一些基于浏览器的播放器不是吗?你不能通过在服务器上使用方法在客户端上播放它。你需要使用一些javascript/html5代码来播放它。 [这个问题](http://stackoverflow.com/questions/8703975/html-5-play-tiny-mp3-inline)可能会有所帮助。 – 2012-04-27 08:13:53
等等可能[这一个](http://stackoverflow.com/questions/1933969/sound-effects-in-javascript-html5)。 – 2012-04-27 08:19:15