Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: empty flush tts text. #4199

Merged
merged 1 commit into from
Sep 14, 2024
Merged

Conversation

sheng-ri
Copy link
Contributor

这段应该使用TextToSpeech::stop而不是使用空字符串。
或许还有测试的含义,但是空字符串也可能是非法的字符串被TTS拒绝。

@@ -31,6 +31,7 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener
private val ttsUtteranceListener = TTSUtteranceListener()
private var speakJob: Coroutine<*>? = null
private val TAG = "TTSReadAloudService"
private var maxRetryCount = 3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段或许应该去掉或者加入设置,但是懒得改了

@821938089
Copy link
Collaborator

821938089 commented Sep 13, 2024

这样写不行,重新初始化后需要return,初始化会有回调再调用play

有更好的修复办法,你直接把那个空字符串换成第一段内容,后续添加朗读队列就跳过第一段

@sheng-ri
Copy link
Contributor Author

这样写不行,重新初始化后需要return,初始化会有回调再调用play

有更好的修复办法,你直接把那个空字符串换成第一段内容,后续添加朗读队列就跳过第一段

我用了一下自己分支确实遇到了这个问题,但是没找到原因。
了解了。

@821938089 821938089 merged commit f074e8b into gedoor:master Sep 14, 2024
@sheng-ri sheng-ri deleted the fix-empty-tts-text branch September 14, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants