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

Feature: 为 voiceflow 提供完整的 ws 的音频流解决方案 #5

Closed
2 tasks done
cubxxw opened this issue Oct 22, 2024 · 0 comments · Fixed by #4
Closed
2 tasks done

Feature: 为 voiceflow 提供完整的 ws 的音频流解决方案 #5

cubxxw opened this issue Oct 22, 2024 · 0 comments · Fixed by #4
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@cubxxw
Copy link
Member

cubxxw commented Oct 22, 2024

Checklist

  • I've searched for similar issues and couldn't find anything matching
  • I've discussed this feature request in the telepace Slack and got positive feedback

Is this feature request related to a problem?

✅ Yes

Problem Description

我希望能满足我对 LLM 语音的基础能力,我的项目是 分析是否有一些语音的开源项目,可以很轻松的实现实时翻译,支持集成多个三方的语音平台(实时翻译的云服务) 或者是本地模型训练的实时翻译的 ws 以及 API, 其中可以支持通过ws实时的将翻译的内容返回给前端

Solution Description

  1. 新增字段设计
  • 音频存储路径 (audio_url):在系统中新增字段 audio_url,用于存储音频文件的访问路径。当用户录制完语音并通过 VoiceFlow 处理后,生成的音频文件将存储在 MinIO 中,并返回对应的 URL 供前端访问。

2. 优化后的业务流程

  1. 用户通过麦克风实时录音
    • 用户点击前端界面上的麦克风按钮开始录音,录音数据通过 WebSocket 实时传递给 VoiceFlow 组件。
  2. 语音转文本(STT)
    • VoiceFlow 接收到语音数据后,调用语音转文本(STT)服务,将用户的语音内容转换为文本,并将结果存储到数据库中。
  3. 与 LLM 交互
    • 直接将语音对接现用支持音频的 LLM 进行交互,生成智能回复的文本内容。
  4. 文本转语音(TTS)
    • LLM 返回的文本结果通过文本转语音(TTS)服务转换为语音,当系统检测到 minio_enabled 为 true 时,生成的音频文件将自动存储到 MinIO 中,并返回文件的 URL。
    • 存储后,系统会返回该音频文件的 URL 地址(即 audio_url),并与会话相关联,记录在数据库中。
  5. 将 MinIO 地址返回给前端
    • 后端将生成的 audio_url 返回给前端,前端可选择通过 WebSocket 或 API 获取此地址。用户在调用业务服务的过程中,前端可以使用该地址将 MinIO 中存储的音频文件发送出去或直接访问播放。
  6. 语音结果返回用户
    • 前端接收到音频文件的 URL 后,通过音频播放器将 MinIO 中存储的语音文件播放给用户,实现语音交互的闭环。
  7. 幂等性保证
    • 系统根据会话 ID 以及音频文件的 audio_url 进行幂等性处理,确保相同的请求不会被重复处理,提升系统的健壮性。

Benefits

解耦开来,并且提供组件级别的能力

Potential Drawbacks

No response

Additional Information

No response

@cubxxw cubxxw self-assigned this Oct 22, 2024
@cubxxw cubxxw added the enhancement New feature or request label Oct 22, 2024
@cubxxw cubxxw added this to the v0.5 milestone Oct 22, 2024
@cubxxw cubxxw closed this as completed in #4 Nov 1, 2024
@github-project-automation github-project-automation bot moved this from Todo ⏰ to Done ✅ in Telepace Planning Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant