Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
功能:
AI 在返回回答时,自动触发调用 TTS 接口,朗读生成的文本内容
特点:
无需等待 AI 内容生成完成,会提前朗读已经生成的句子。(可以调节断句频率)
需求场景与灵感来源:
Tony Dinh 🎯 on X: "Playing game with GPT-4: 🕶️ This is an experiment to talk with AI in real-time (the AI will start talking back to you immediately without waiting for GPT-4 to finish generating) Drop a like ❤️ and I'll deploy it later today for you to try it yourself! 🥰 https://t.co/DiuyRGhwa4" / X
我在本地测试 chatbox 时,输入使用语音输入(现在很多输入法自带),然后将 AI 生成的回答进行 TTS,实现了语音实时沟通的效果。目前输入完成还需要手动按 Enter,也可以考虑直接提交的方式(一段时间没有输入之后,自动提交)。
TODO:
1 默认调用 elevenlabs 的 API,没有支持其它 API
2 没有完成设置 UI (设置 API key 或 voiceId)
3 生成错误没有界面 UI 提示
4 没有启用或禁用此功能的 UI
其它
提交 PR 时,发现 #336 已经实现了类似的功能,超棒。
这个 PR 是我本地测试之后的成果,用得着的话,就收下吧~ 😋