我正在尝试使用 google 的 TTS 服务将 mp3 拉入我的 PhoneGap (Cordova 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 中播放它......?
担