Hk-Gosuto / ChatGPT-Next-Web-LangChain

一键拥有你自己的 ChatGPT 网页服务。 One-Click to deploy your own ChatGPT web UI.(基于 langchain 实现的插件版本 Plugin version implemented based on langchain)

Home Page:https://n3xt.chat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] 文本转语音功能报错:EncodingError: Decoding failed

laye0619 opened this issue · comments

Bug Description

尝试使用文本转语音功能报错,同样的API Key在LobeChat中文本转语音(模型使用tts-1)就是正常的。错误信息如下
Screenshot 2024-04-09 at 08 25 17

Steps to Reproduce

设置中启用文本转语音功能,模型选择tts-1或者tts-1-hd
在对话中随便选择一条文字,点击“朗读”
出错如上图

Expected Behavior

可以正常朗读

Screenshots

No response

Deployment Method

  • Docker
  • Vercel
  • Server

Desktop OS

No response

Desktop Browser

No response

Desktop Browser Version

No response

Smartphone Device

No response

Smartphone OS

No response

Smartphone Browser

No response

Smartphone Browser Version

No response

Additional Logs

No response

检查一下接口调用看看是否正常,如果接口返回正常提供一下使用的浏览器和对应版本,也可能是浏览器 API 兼容问题。
演示环境我刚试了一下是正常的。
image

Bot detected the issue body's language is not English, translate it automatically.


Check the interface call to see if it is normal. If the interface returns normally, please provide the browser used and the corresponding version. It may also be a browser API compatibility issue.
I just tried the demo environment and it is normal.
image

还是不行,三张图对比一下:

  1. 使用docker部署您的项目
Screenshot 2024-04-09 at 09 51 19
  1. 使用vercel部署您的项目
Screenshot 2024-04-09 at 09 50 54
  1. 使用lobeChat使用同样的API Key成功的截图
Screenshot 2024-04-09 at 09 50 01

docker 和 vercel 版本都没有复现这个问题,你的中转服务是不是不支持 v1/audio/speech 路由的请求?

Bot detected the issue body's language is not English, translate it automatically.


Neither docker nor vercel versions reproduce this problem. Does your transit service not support v1/audio/speech routing requests?

抱歉哈 中转服务是什么意思?我使用的是官方openai api

Bot detected the issue body's language is not English, translate it automatically.


Sorry, what does transit service mean? I am using the official openai api

就是是否有单独配置 BASE_URL 环境变量,tts 的请求这里只是中转到了 openai 的 v1/audio/speech 接口中,不太可能出现类似 404 的问题。
或者你看下后端的日志中是否有相关的错误信息?

openai 的接口文档:https://platform.openai.com/docs/guides/text-to-speech?lang=curl

Bot detected the issue body's language is not English, translate it automatically.


That is, whether the BASE_URL environment variable is configured separately, the tts request is only forwarded to the v1/audio/speech interface of openai, and it is unlikely that problems like 404 will occur.
Or can you check if there are any relevant error messages in the backend logs?

openai’s interface documentation: https://platform.openai.com/docs/guides/text-to-speech?lang=curl

感谢大神!问题解决了,是我配置的问题,耽误了您很多时间十分抱歉!

Bot detected the issue body's language is not English, translate it automatically.


Thank you God! The problem has been solved. It was a problem with my configuration. I'm sorry for wasting a lot of your time!

Close it.