gpt4 book ai didi

android - LG Optimus S 收到并处理了 TTS 文本但听不到

转载 作者:太空狗 更新时间:2023-10-29 14:30:19 27 4
gpt4 key购买 nike

一方面,这个问题很棘手,因为我有完全相同的代码在 3 款不同的 Android 2.2 手机上完美工作,但在 LG Optimus S(也运行 Android 2.2)上却不工作。

另一方面,这个问题是可重现的,所以在解开这个谜团的路上可能会有一些希望。

问题本身表明,传递给 TTS 引擎 (Pico) 的前两个文本 fragment 在所有手机上都得到了正确处理(并通过扬声器听到!),包括有问题的手机 (LG Optimus S)。

但是第三和第四段传递给 TTS 引擎,在语音 RecognitionController 的识别步骤之后,在所有手机中产生完全良性的日志,除了有问题的手机什么都听不到通过扬声器! - 尽管收到所有 OnUtteranceCompleted() 甚至是有问题的电话!

我知道代码是正确的,因为它在所有其他手机上都能完美运行,所以我不知道是什么原因造成的。

这会不会是 CPU 资源不足?内存资源不足?

如果是这样,为什么它对前 2 个文本段有效,但对连续的 2 个文本段无效?

如果这有助于发现系统行为中的某些“奇怪”的东西,我在有问题的电话上包含了一个丢失的 TTS 语音的示例 logcat:

INFO/RecognitionController(1773): State change: RECOGNIZING -> RECOGNIZED
INFO/RecognitionController(1773): Final state: RECOGNIZED
INFO/ServerConnectorImpl(1773): ClientReport{session_id=040af29064d281350f1325c6a361f003,request_id=1,application_id=voice-search,client_perceived_request_status=0,request_ack_latency_ms=93,total_latency_ms=2179,user_perceived_latency_ms=213,network_type=1,endpoint_trigger_type=3,}
INFO/AudioService(121): AudioFocus abandonAudioFocus() from android.media.AudioManager@45a4f450
DEBUG/AppRecognizer(2167): Proceed.
INFO/TTS received:(2167): Speaking text segment number three but NOTHING is coming out of the speaker!!!
VERBOSE/TtsService(572): TTS service received Speaking text segment number three but NOTHING is coming out of the speaker!!!
VERBOSE/TtsService(572): TTS processing: Speaking text segment number three but NOTHING is coming out of the speaker!!!
VERBOSE/TtsService(572): TtsService.setLanguage(eng, USA, )
INFO/SVOX Pico Engine(572): Language already loaded (en-US == en-US)
INFO/SynthProxy(572): setting speech rate to 100
INFO/SynthProxy(572): setting pitch to 100
INFO/ClientReportSender(1773): Sending 1 client reports over HTTP
INFO/TTS received:(2167): Speaking text segment number four but NOTHING is coming out of the speaker!!!
VERBOSE/TtsService(572): TTS service received Speaking text segment number four but NOTHING is coming out of the speaker!!!
WARN/AudioTrack(572): obtainBuffer timed out (is the CPU pegged?) 0x5b3988 user=00062b40, server=00061b40
VERBOSE/TtsService(572): TTS callback: dispatch started
VERBOSE/TtsService(572): TTS callback: dispatch completed to 1
VERBOSE/TtsService(572): TTS processing: Speaking text segment number four but NOTHING is coming out of the speaker!!!
VERBOSE/onUtteranceCompleted(2167): segment #3
VERBOSE/TtsService(572): TtsService.setLanguage(eng, USA, )
INFO/SVOX Pico Engine(572): Language already loaded (en-US == en-US)
INFO/SynthProxy(572): setting speech rate to 100
INFO/SynthProxy(572): setting pitch to 100
WARN/AudioTrack(572): obtainBuffer timed out (is the CPU pegged?) 0x5b3988 user=0007dc00, server=0007cc00
VERBOSE/TtsService(572): TTS callback: dispatch started
VERBOSE/TtsService(572): TTS callback: dispatch completed to 1
VERBOSE/onUtteranceCompleted(2167): segment #4

完美运行的手机上的相应日志如下所示:

INFO/RecognitionController(1773): State change: RECOGNIZING -> RECOGNIZED
INFO/RecognitionController(1773): Final state: RECOGNIZED
INFO/ServerConnectorImpl(1773): ClientReport{session_id=040af29064d281350f1325c6a361f003,request_id=1,application_id=voice-search,client_perceived_request_status=0,request_ack_latency_ms=96,total_latency_ms=2449,user_perceived_latency_ms=140,network_type=1,endpoint_trigger_type=3,}
INFO/AudioService(121): AudioFocus abandonAudioFocus() from android.media.AudioManager@46039d08
DEBUG/AppRecognizer(2167): Proceed.
INFO/TTS received:(2167): Speaking text segment number three (and I can hear it :)
VERBOSE/TtsService(572): TTS service received Speaking text segment number three (and I can hear it :)
VERBOSE/TtsService(572): TTS processing: Speaking text segment number three (and I can hear it :)
INFO/ClientReportSender(1773): Sending 1 client reports over HTTP
VERBOSE/TtsService(572): TtsService.setLanguage(eng, USA, )
INFO/SVOX Pico Engine(572): TtsEngine::setLanguage found matching language(eng) but not matching country().
INFO/SVOX Pico Engine(572): Language already loaded (en-US == en-US)
INFO/SynthProxy(572): setting speech rate to 100
INFO/SynthProxy(572): setting pitch to 100
INFO/TTS received:(2167): Speaking text segment number four (and I can hear it :)
VERBOSE/TtsService(572): TTS service received Speaking text segment number four (and I can hear it :)
INFO/AudioHardwareQSD(121): AudioHardware pcm playback is going to standby.
DEBUG/dalvikvm(3262): GC_EXPLICIT freed 6946 objects / 326312 bytes in 76ms
WARN/AudioTrack(572): obtainBuffer timed out (is the CPU pegged?) 0x3ce730 user=00032e80, server=00031e80
WARN/AudioFlinger(121): write blocked for 170 msecs, 161 delayed writes, thread 0xdc08
VERBOSE/TtsService(572): TTS callback: dispatch started
VERBOSE/onUtteranceCompleted(2167): segment #3
VERBOSE/TtsService(572): TTS callback: dispatch completed to 1
VERBOSE/TtsService(572): TTS processing: Speaking text segment number four (and I can hear it :)
VERBOSE/TtsService(572): TtsService.setLanguage(eng, USA, )
INFO/SVOX Pico Engine(572): TtsEngine::setLanguage found matching language(eng) but not matching country().
INFO/SVOX Pico Engine(572): Language already loaded (en-US == en-US)
INFO/SynthProxy(572): setting speech rate to 100
INFO/SynthProxy(572): setting pitch to 100
WARN/KeyCharacterMap(2167): No keyboard for id 131074
WARN/KeyCharacterMap(2167): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
DEBUG/dalvikvm(7137): GC_EXPLICIT freed 1585 objects / 93216 bytes in 67ms
DEBUG/dalvikvm(6697): GC_EXPLICIT freed 3108 objects / 178688 bytes in 59ms
VERBOSE/TtsService(572): TTS callback: dispatch started
VERBOSE/onUtteranceCompleted(2167): segment #4

更新 I:问题(仅在 LG Optimus S LS670 中)仅发生在语音识别器 首次启动后。我可以发送任意数量的文本 fragment ,其中一些很长,而且 TTS 引擎可以完美地大声朗读。但是当电话进入收听状态时(当然不是在说话的同时),TTS 就会停止大声播放。好像一旦语音识别器启动,某些说话者就会自动“静音”,但一旦语音识别完成,就不会自动恢复。

实际上,我继续尝试在 RecognitionListener.onEndOfSpeech() 中插入 audioManager.setMicrophoneMute(false);,但这没有帮助。

更新 II:我什至尝试向 RecognitionListener.onEndOfSpeech() 添加以下内容,认为重新启动 TTS 引擎可能会在某处重置错误 - 这也无济于事:

Intent checkIntent = new Intent();
checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(checkIntent, TTS_STATCHECK);

想法?有什么建议吗?

最佳答案

只需接受从 Android 2.2.2 (Froyo) 到 Android 2.3.3 (Gingerbread) 的 OTA 固件更新即可解决问题。

事实证明这是操作系统中的一个错误,在那个特定的 ROM (LS670ZVD) 中,而不是在我的代码中。

关于android - LG Optimus S 收到并处理了 TTS 文本但听不到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7462531/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com