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

[TTS语音合成] UnboundLocalError: local variable 'wav_all' referenced before assignment #2699

Closed
newuserforstudy opened this issue Nov 29, 2022 · 4 comments
Assignees

Comments

@newuserforstudy
Copy link

使用语音合成时遇到了3个问题:
1)我对一个文本中的多条数据逐条进行语音合成时,进行到3772条时程序报错:UnboundLocalError: local variable 'wav_all' referenced before assignment 。是程序漏洞吗?
2)我使用混合模型mix合成包含中文、英文、数字的内容时,英文内容不能合成。如 "welcome to 北京2008",这种情况如何处理?
3)我想使用男声进行语音合成,但是根据推荐,我根据示例:
from paddlespeech.cli.tts.infer import TTSExecutor
tts = TTSExecutor()
tts(am="fastspeech2_male", voc="pwgan_male", text="今天天气十分不错。", output="output.wav")
报错:AssertionError: Can't find "fastspeech2_male-zh" in resource.
我看了其他的issue,提到了使用男声的方法,我想问的时,有没有明确的使用男声的方法?

期待回复!3ks!

@yt605155624
Copy link
Collaborator

yt605155624 commented Nov 29, 2022

@newuserforstudy
Copy link
Author

[TTS 语音合成] 感谢!根据提示,我解决了问题1和3。
但是问题2仍然存在问题,问题是:使用混合模型mix时,会将数字当作英文EN处理,如何做能够将数字作为中文ZH处理,而我使用中文ZH模型时英文内容又处理不了,请问如何解决我的困境?
举例如下:
今天天气十分不错 hello world 1 2 3;
合成结果:今天天气十分不错 hello world one two three;
我想要的结果:今天天气十分不错 hello world 一/幺 二 三。

3ks !!

@yt605155624
Copy link
Collaborator

看下混合文本前端的规则,目前数字是跟着前面的类型的,所以数字前面是英文则会念成英文,不想改代码的话只能自己先把数字转成中文https://github.com/PaddlePaddle/PaddleSpeech/blob/develop/paddlespeech/t2s/frontend/mix_frontend.py

@newuserforstudy
Copy link
Author

看下混合文本前端的规则,目前数字是跟着前面的类型的,所以数字前面是英文则会念成英文,不想改代码的话只能自己先把数字转成中文https://github.com/PaddlePaddle/PaddleSpeech/blob/develop/paddlespeech/t2s/frontend/mix_frontend.py

ok! 3ks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants