我試圖運行在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