2012-12-25 20 views
0

我想使用谷歌的TTS服務拉mp3到我的PhoneGap(科爾多瓦2.3.0rc1)應用程序,並播放它們。需要幫助,找到音頻不播放在阿爾法科爾多瓦的原因2.3.0rc1

我需要更多的信息,爲什麼音頻停止爲我工作。其他人是否可以確認其有效或無效?

此:

{ 
    var url = 'http://translate.google.com/translate_tts?tl=en&q=are+you+messing+with+me?'; 
    var snd = new Audio(url); 
    snd.load(); 
    snd.play(); 
} 

結果在此:

2012-12-24 16:45:54.365 myAPP[1614:907] [LOG] HTML5 audio capable. 
2012-12-24 16:45:56.413 myAPP[1614:907] [MPAVController] Autoplay: Enabling autoplay 
2012-12-24 16:45:56.437 myAPP[1614:907] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1) 
2012-12-24 16:45:57.227 myAPP[1614:907] [MPAVController] Autoplay: Disabling autoplay for pause 
2012-12-24 16:45:57.230 myAPP[1614:907] [MPAVController] Autoplay: Disabling autoplay 
2012-12-24 16:45:57.280 myAPP[1614:907] [MPAVController] Autoplay: Enabling autoplay 
2012-12-24 16:45:57.414 myAPP[1614:907] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0 
2012-12-24 16:45:57.480 myAPP[1614:907] [MPAVController] Autoplay: Enabling autoplay 
2012-12-24 16:45:57.522 myAPP[1614:907] [MPAVController] Autoplay: Enabling autoplay 
2012-12-24 16:45:57.609 myAPP[1614:907] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0 
2012-12-24 16:46:01.150 myAPP[1614:907] [MPAVController] Autoplay: Likely to keep up or full buffer: 0 
2012-12-24 16:46:01.153 myAPP[1614:907] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up. 
2012-12-24 16:46:01.163 myAPP[1614:907] [MPAVController] Autoplay: _streamLikelyToKeepUp: 0 -> 1 
2012-12-24 16:46:01.166 myAPP[1614:907] [MPAVController] Autoplay: Likely to keep up or full buffer: 1 
2012-12-24 16:46:01.191 myAPP[1614:907] [MPAVController] Autoplay: Enabling autoplay 
2012-12-24 16:46:03.346 myAPP[1614:907] [MPAVController] Autoplay: _streamUnlikelyToKeepUp: 1 -> 0 
2012-12-24 16:46:03.352 myAPP[1614:907] [MPAVController] Autoplay: Likely to keep up or full buffer: 0 
2012-12-24 16:46:03.355 myAPP[1614:907] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up. 
2012-12-24 16:46:03.358 myAPP[1614:907] [MPAVController] Autoplay: _streamRanDry: 0 -> 1 
2012-12-24 16:46:03.389 myAPP[1614:907] [MPAVController] Autoplay: Took background task assertion (8) for playback stall 
2012-12-24 16:46:03.398 myAPP[1614:907] [MPAVController] Autoplay: Likely to keep up or full buffer: 0 
2012-12-24 16:46:03.403 myAPP[1614:907] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up. 
2012-12-24 16:46:03.405 myAPP[1614:907] [MPAVController] Autoplay: Disabling autoplay 
2012-12-24 16:46:03.408 myAPP[1614:907] [MPAVController] Autoplay: Disabling autoplay for pause 
2012-12-24 16:46:03.411 myAPP[1614:907] [MPAVController] Autoplay: Disabling autoplay 

另一種方法是做一個jQuery下載並播放出來一個div ....?

回答

0

嘛音頻代碼API沒有很好地在Web視圖這可能是,你正在運行到問題的支持。你可能想切換到使用PhoneGap Media API來播放你的mp3文件。在某些時候,我一直想重寫這個API以符合音頻API,但我還沒有時間。

另外,如果你只是想TTS的東西,你爲什麼不使用我寫的TTS Plugin在設備上做轉換?