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

生成音频时报错 #56

Closed
jerryblues opened this issue Mar 25, 2024 · 27 comments
Closed

生成音频时报错 #56

jerryblues opened this issue Mar 25, 2024 · 27 comments

Comments

@jerryblues
Copy link

generating audio

2024-03-25 16:35:38.413 | INFO | app.services.voice:tts:12 - start, voice name: zh-CN-XiaoxiaoNeural
2024-03-25 16:40:39.370 | ERROR | app.services.voice:tts:29 - failed, error:
2024-03-25 16:40:39.371 | ERROR | app.services.task:start:77 - failed to generate audio, maybe the network is not available. if you are in China, please use a VPN.

经过测试,在linux服务器上,使用 edge-tts,也无法正常文字转语音,这是为啥,服务器上也已经配了代理服务器,linux上的服务器可以访问 google 和 microsoft azune

另外,配置文件中 subtitle_provider = "whisper" 或 "edge" 都测试过,是一样的报错

求指点~

@harry0703
Copy link
Owner

这个应该就是网络问题

  1. tts走的是websocket
  2. whipser需要访问 huggingface 下载模型

@jerryblues
Copy link
Author

通过 proxychains 解决了,thanks

@lmx01
Copy link

lmx01 commented Mar 26, 2024

请问如何解决的?我mac电脑全局已经配置了VPN,可以翻墙,但是,这个项目还是报这个错

@congziqi77
Copy link

请问如何解决的?我mac电脑全局已经配置了VPN,可以翻墙,但是,这个项目还是报这个错
同样问题 请问你解决了吗?

@jerryblues
Copy link
Author

请问如何解决的?我mac电脑全局已经配置了VPN,可以翻墙,但是,这个项目还是报这个错

我的方法如下,具体可以问下gpt proxychains的使用方法:
sudo apt-get install proxychains
编辑 /etc/proxychains.conf,在文件的末尾添加你的代理服务器
启动命令: proxychains

@jerryblues
Copy link
Author

请问如何解决的?我mac电脑全局已经配置了VPN,可以翻墙,但是,这个项目还是报这个错
同样问题 请问你解决了吗?

我的方法如下,具体可以问下gpt proxychains的使用方法:
sudo apt-get install proxychains
编辑 /etc/proxychains.conf,在文件的末尾添加你的代理服务器
启动命令: proxychains

@harry0703
Copy link
Owner

@lmx01 比如我的VPN,是类似这样的,设置就没问题了
image

或者你也可以试试 @jerryblues 的方法

@JamesMonges
Copy link

我的在window上跑的,出现了下面的错误:

generating audio

2024-04-05 00:19:03 | INFO | "./app\services\voice.py:997": tts - start, voice name: , try: 1
2024-04-05 00:19:03 | ERROR | "./app\services\voice.py:1018": tts - failed, error: Invalid voice ''.
2024-04-05 00:19:03 | INFO | "./app\services\voice.py:997": tts - start, voice name: , try: 2
2024-04-05 00:19:03 | ERROR | "./app\services\voice.py:1018": tts - failed, error: Invalid voice ''.
2024-04-05 00:19:03 | INFO | "./app\services\voice.py:997": tts - start, voice name: , try: 3
2024-04-05 00:19:03 | ERROR | "./app\services\voice.py:1018": tts - failed, error: Invalid voice ''.
2024-04-05 00:19:03 | ERROR | "./app\services\task.py:80": start - failed to generate audio, maybe the network is not available. if you are in China, please use a VPN.
我已经开启了全局的VPN,也能访问GPT,楼上的方式我好像行不通,目前不知道如何处理?

@monk-after-90s
Copy link

搞不懂,已经在HK服务器上跑,也是这样

@longzhihua
Copy link

全局代理我这边也是失败的。
image
image

@harry0703
Copy link
Owner

命令行执行

curl https://www.google.com

看看会不会报错

@harry0703
Copy link
Owner

@JamesMonges 你这个是声音设置错了,你是用的API还是Web

@longzhihua
Copy link

命令行执行

curl https://www.google.com

看看会不会报错

我在终端中访问,无响应。并且 ping 也是失败的。但是浏览器可以打开 google.com.hk

@monk-after-90s
Copy link

对 音频合成得选语种一样的

@longzhihua
Copy link

对 音频合成得选语种一样的

+1 ,这个是导致这个问题的本质原因。如果你是使用中文,就需要选择中文的人声。

@jj3214
Copy link

jj3214 commented Apr 19, 2024

我curl可以正常请求https://www.google.com,但是还是报错2024-04-19 15:26:04 | INFO | "./app\services\voice.py:1042": azure_tts_v1 - start, voice name: , try: 1
2024-04-19 15:26:04 | ERROR | "./app\services\voice.py:1063": azure_tts_v1 - failed, error: Invalid voice ''.
2024-04-19 15:26:04 | INFO | "./app\services\voice.py:1042": azure_tts_v1 - start, voice name: , try: 2
2024-04-19 15:26:04 | ERROR | "./app\services\voice.py:1063": azure_tts_v1 - failed, error: Invalid voice ''.
2024-04-19 15:26:04 | INFO | "./app\services\voice.py:1042": azure_tts_v1 - start, voice name: , try: 3
2024-04-19 15:26:04 | ERROR | "./app\services\voice.py:1063": azure_tts_v1 - failed, error: Invalid voice ''.
2024-04-19 15:26:04 | ERROR | "./app\services\task.py:80": start - failed to generate audio, maybe the network is not available. if you are in China, please use a VPN. 要如何解决?

@harry0703
Copy link
Owner

合成声音设置错误,比如用 zh-CN-XiaoxiaoNeural 试试看。具体的列表可以参考 docs 目录下面的 voice-list.txt

@jj3214
Copy link

jj3214 commented Apr 19, 2024

还是不行,我是windows,用的是api的形式,请求参数是{
"video_subject": "string",
"video_script": "风景如诗,风景如画。让我们一起探索那迷人的自然美景。从山脉到河流,从森林到草原,每一处都充满了生命的气息和大自然的魅力。站在山顶上,你可以感受到一种无名的力量,感受到自己与宇宙的联系。向下看,你可以看到风景的千变万化,这是一个充满活力和色彩的世界。不论是在日出时分欣赏湖面的晨雾,还是在夕阳时候欣赏傍晚的晚霞,自然景观始终让人心动。走进森林,你会听到鸟鸣,感受到清新的空气和生命的律动。在大沙漠中你会看到风的力量,感觉到一种孤独而美丽的寂静。每一处风景都在我们心中留下深刻的印象,唤起我们对世界的向往和对生活的热爱。",
"video_terms": "string",
"video_aspect": "9:16",
"video_concat_mode": "random",
"video_clip_duration": 5,
"video_count": 1,
"video_language": "zh",
"voice_name": "",
"voice_volume": 1,
"bgm_type": "random",
"bgm_file": "",
"bgm_volume": 0.2,
"subtitle_enabled": true,
"subtitle_position": "bottom",
"font_name": "STHeitiMedium.ttc",
"text_fore_color": "#FFFFFF",
"text_background_color": "transparent",
"font_size": 60,
"stroke_color": "#000000",
"stroke_width": 1.5,
"n_threads": 2,
"paragraph_number": 1,
"voice":"zh-CN-XiaoxiaoNeural"
},然后还是一样的报错

@harry0703
Copy link
Owner

"voice_name": "zh-CN-XiaoxiaoNeural"

我看你发的请求参数,voice_name 是空的

@jj3214
Copy link

jj3214 commented Apr 19, 2024

我更换了voice_name后确实可以了,现在出现新的问题2024-04-19 16:22:46 | INFO | "./app\services\material.py:51": search_videos - searching videos: https://api.pexels.com/videos/search?query=Naruto%27s+Life+Journey&per_page=20&orientation=portrait, with proxies: {'http': 'http://xxx.xxx.xxx.xxx:xxxx', 'https': 'http://xxx.xxx.xxx.xxx:xxxx'}
2024-04-19 16:22:47 | ERROR | "./app\services\material.py:58": search_videos - search videos failed: {'status': 401, 'code': 'Unauthorized'}
2024-04-19 16:22:47 | INFO | "./app\services\material.py:140": download_videos - found 0 videos for 'Naruto's Life Journey'
2024-04-19 16:22:47 | INFO | "./app\services\material.py:51": search_videos - searching videos: https://api.pexels.com/videos/search?query=Rising+Hokage%3A+Naruto%27s+Legacy&per_page=20&orientation=portrait, with proxies: {'http': 'http://xxx.xxx.xxx.xxx:xxxx', 'https': 'http://xxx.xxx.xxx.xxx:xxxx'}
2024-04-19 16:22:48 | ERROR | "./app\services\material.py:58": search_videos - search videos failed: {'status': 401, 'code': 'Unauthorized'}
2024-04-19 16:22:48 | INFO | "./app\services\material.py:140": download_videos - found 0 videos for 'Rising Hokage: Naruto's Legacy'
2024-04-19 16:22:48 | INFO | "./app\services\material.py:51": search_videos - searching videos: https://api.pexels.com/videos/search?query=Friendship+%26+Dreams%3A+Naruto%27s+Tale&per_page=20&orientation=portrait, with proxies: {'http': 'http://xxx.xxx.xxx.xxx:xxxx', 'https': 'http://xxx.xxx.xxx.xxx:xxxx'}
2024-04-19 16:22:48 | ERROR | "./app\services\material.py:58": search_videos - search videos failed: {'status': 401, 'code': 'Unauthorized'}
2024-04-19 16:22:48 | INFO | "./app\services\material.py:140": download_videos - found 0 videos for 'Friendship & Dreams: Naruto's Tale'
2024-04-19 16:22:48 | INFO | "./app\services\material.py:51": search_videos - searching videos: https://api.pexels.com/videos/search?query=Ninja+Battles+%26+Triumphs%3A+Naruto%27s+Story&per_page=20&orientation=portrait, with proxies: {'http': 'http://xxx.xxx.xxx.xxx:xxxx', 'https': 'http://xxx.xxx.xxx.xxx:xxxx'}
2024-04-19 16:22:49 | ERROR | "./app\services\material.py:58": search_videos - search videos failed: {'status': 401, 'code': 'Unauthorized'}
2024-04-19 16:22:49 | INFO | "./app\services\material.py:140": download_videos - found 0 videos for 'Ninja Battles & Triumphs: Naruto's Story'
2024-04-19 16:22:49 | INFO | "./app\services\material.py:51": search_videos - searching videos: https://api.pexels.com/videos/search?query=From+Outcast+to+Hero%3A+Naruto%27s+Inspiring+Saga&per_page=20&orientation=portrait, with proxies: {'http': 'http://xxx.xxx.xxx.xxx:xxxx', 'https': 'http://xxx.xxx.xxx.xxx:xxxx'}
2024-04-19 16:22:50 | ERROR | "./app\services\material.py:58": search_videos - search videos failed: {'status': 401, 'code': 'Unauthorized'}
2024-04-19 16:22:50 | INFO | "./app\services\material.py:140": download_videos - found 0 videos for 'From Outcast to Hero: Naruto's Inspiring Saga'
2024-04-19 16:22:50 | INFO | "./app\services\material.py:148": download_videos - found total videos: 0, required duration: 131 seconds, found duration: 0.0 seconds
2024-04-19 16:22:50 | SUCCESS | "./app\services\material.py:176": download_videos - downloaded 0 videos
2024-04-19 16:22:50 | ERROR | "./app\services\task.py:123": start - failed to download videos, maybe the network is not available. if you are in China, please use a VPN. 这是我的代理的问题吗

@harry0703
Copy link
Owner

这个是你的API KEY的问题,去 https://www.pexels.com/api/ 申请一个,免费的

@hy546880109
Copy link

这个是你的API KEY的问题,去 https://www.pexels.com/api/ 申请一个,免费的

申请完成后,填写在哪个地方?

@harry0703
Copy link
Owner

在界面上,点击基础设置,填写进去即可

@lipeng1109
Copy link

我使用中文,选择zh-CN-XiaoxiaoNeural,少数情况可以生成语音,大部分时候出现:
failed to generate audio, maybe the network is not available. if you are in China, please use a VPN. 实在不知道怎么解决了

@harry0703
Copy link
Owner

@lipeng1109 这个问题,一般还是网络原因,因为要连接微软的服务器(海外),网络不是特别好,建议你用VPN,就可以了

@9ihbd2DZSMjtsf7vecXjz
Copy link

@lipeng1109 这个问题,一般还是网络原因,因为要连接微软的服务器(海外),网络不是特别好,建议你用VPN,就可以了

我的网络是畅通的,用的gemini的apikey和pexels的apikey, 请问生成到这步骤报错是哪里的问题? 非常感谢, 求指点

2024-10-20 00:41:00.295 | INFO | app.services.task:generate_audio:75 -

generating audio

2024-10-20 00:41:00.299 | INFO | app.services.voice:azure_tts_v1:1057 - start, voice name: zh-CN-XiaoxiaoNeural, try: 1

2024-10-20 00:41:01.732 | ERROR | app.services.voice:azure_tts_v1:1080 - failed, error: 403, message='Invalid response status', url=URL('wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4&ConnectionId=0d725972364d4128a03afdb8a6332bb5')

2024-10-20 00:41:01.740 | INFO | app.services.voice:azure_tts_v1:1057 - start, voice name: zh-CN-XiaoxiaoNeural, try: 2

2024-10-20 00:41:03.368 | ERROR | app.services.voice:azure_tts_v1:1080 - failed, error: 403, message='Invalid response status', url=URL('wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4&ConnectionId=9ab51e6a30b64dcea81dbfce3ba233f1')

2024-10-20 00:41:03.377 | INFO | app.services.voice:azure_tts_v1:1057 - start, voice name: zh-CN-XiaoxiaoNeural, try: 3

2024-10-20 00:41:04.804 | ERROR | app.services.voice:azure_tts_v1:1080 - failed, error: 403, message='Invalid response status', url=URL('wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4&ConnectionId=e79414d188c1457d84459b2eab4194c2')

2024-10-20 00:41:04.813 | ERROR | app.services.task:generate_audio:85 - failed to generate audio:

  1. check if the language of the voice matches the language of the video script.
  2. check if the network is available. If you are in China, it is recommended to use a VPN and enable the global traffic mode.

2024-10-20 00:41:04.821 | ERROR | main::790 - 视频生成失败

@9ihbd2DZSMjtsf7vecXjz
Copy link

@lipeng1109 这个问题,一般还是网络原因,因为要连接微软的服务器(海外),网络不是特别好,建议你用VPN,就可以了

看起来链接gemini正常卡在音频这里了, 一直403, 求指点,感谢

报错内容分割线

2024-10-20 00:40:56 | INFO | "./app\services\task.py:210": start - start task: b83dd9d3-0774-452a-9f53-ea5ef09e6536, stop_at: video
2024-10-20 00:40:56 | INFO | "./app\services\task.py:18": generate_script -

generating video script

2024-10-20 00:40:56 | INFO | "./app\services\llm.py:282": generate_script - subject: 去看星星
2024-10-20 00:40:56 | INFO | "./app\services\llm.py:18": _generate_response - llm provider: gemini
2024-10-20 00:41:00 | SUCCESS | "./app\services\llm.py:323": generate_script - completed:
在繁忙的城市生活中,我们常常忘记抬头仰望星空。今晚,让我们放下手机,走出家门,去寻找那片璀璨的星河,感受宇宙的浩瀚与神秘。
2024-10-20 00:41:00 | INFO | "./app\services\task.py:38": generate_terms -

generating video terms

2024-10-20 00:41:00 | DEBUG | "./app\services\task.py:52": generate_terms - video terms: [
"stargazing",
"starry night",
"stars and moon",
"night sky",
"astronomy"
]
2024-10-20 00:41:00 | INFO | "./app\services\task.py:75": generate_audio -

generating audio

2024-10-20 00:41:00 | INFO | "./app\services\voice.py:1057": azure_tts_v1 - start, voice name: zh-CN-XiaoxiaoNeural, try: 1
2024-10-20 00:41:01 | ERROR | "./app\services\voice.py:1080": azure_tts_v1 - failed, error: 403, message='Invalid response status', url=URL('wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4&ConnectionId=0d725972364d4128a03afdb8a6332bb5')
2024-10-20 00:41:01 | INFO | "./app\services\voice.py:1057": azure_tts_v1 - start, voice name: zh-CN-XiaoxiaoNeural, try: 2
2024-10-20 00:41:03 | ERROR | "./app\services\voice.py:1080": azure_tts_v1 - failed, error: 403, message='Invalid response status', url=URL('wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4&ConnectionId=9ab51e6a30b64dcea81dbfce3ba233f1')
2024-10-20 00:41:03 | INFO | "./app\services\voice.py:1057": azure_tts_v1 - start, voice name: zh-CN-XiaoxiaoNeural, try: 3
2024-10-20 00:41:04 | ERROR | "./app\services\voice.py:1080": azure_tts_v1 - failed, error: 403, message='Invalid response status', url=URL('wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4&ConnectionId=e79414d188c1457d84459b2eab4194c2')
2024-10-20 00:41:04 | ERROR | "./app\services\task.py:85": generate_audio - failed to generate audio:

  1. check if the language of the voice matches the language of the video script.
  2. check if the network is available. If you are in China, it is recommended to use a VPN and enable the global traffic mode.
    2024-10-20 00:41:04 | ERROR | "./webui\Main.py:790": - 视频生成失败

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

No branches or pull requests