0

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

もう 1 つの方法は、jquery をダウンロードして div から再生することです。

ダン

4

1 に答える 1

0

Web ビューではオーディオ タグ API が十分にサポートされていないため、問題が発生している可能性があります。mp3 ファイルを再生するには、 PhoneGap Media APIを使用するように切り替えることをお勧めします。ある時点で、この API を Audio API に準拠するように書き直すつもりでしたが、まだ時間がありませんでした。

また、単に TTS が必要な場合は、私が書いたTTS プラグインを使用してデバイス上で変換を行ってみませんか?

于 2012-12-27T15:39:54.020 に答える