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

API中的google_text_synthesize问题 #43

Closed
slmt123 opened this issue Jun 13, 2024 · 3 comments
Closed

API中的google_text_synthesize问题 #43

slmt123 opened this issue Jun 13, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@slmt123
Copy link

slmt123 commented Jun 13, 2024

您好,当我用google_text_synthesize方法传入ssml时:
File "F:\ChatTTS-Forge\modules\api\impl\google_api.py", line 159, in google_text_synthesize
sf.write(buffer, audio_data, sample_rate, format="wav")
File "C:\Users\Mayn\AppData\Local\Programs\Python\Python310\lib\site-packages\soundfile.py", line 429, in write
channels = data.shape[1]
IndexError: tuple index out of range
ChatGPT的回复是“问题很可能出在传递给soundfile.write()的音频数据的格式和形状上。我们需要确保audio_data的格式是正确的,以便soundfile.write()能够处理它。首先,让我们确保audio_data是一个NumPy数组,并且它的形状适用于soundfile.write()。”

@zhzLuke96
Copy link
Member

zhzLuke96 commented Jun 13, 2024

使用最新代码重试

要是还有问题请提供详细运行环境详细包括git commit hash

@slmt123
Copy link
Author

slmt123 commented Jun 14, 2024

刚刚重新clone了一下
commit 5820e57 (grafted, HEAD -> main, origin/main, origin/HEAD)

通过webui.py启动,设置了API=True
webui是正常的,在使用API中的[/v1/text:synthesize]

enhancerConfig中enabled:true的时候
ERROR:root:local variable 'sample_rate' referenced before assignment
Traceback (most recent call last):
File "F:\ChatTTS-Forge\modules\api\impl\google_api.py", line 179, in google_text_synthesize
sr=sample_rate,
UnboundLocalError: local variable 'sample_rate' referenced before assignment

enhancerConfig中enabled:false的时候
ERROR:root:local variable 'sample_rate' referenced before assignment
Traceback (most recent call last):
File "F:\ChatTTS-Forge\modules\api\impl\google_api.py", line 191, in google_text_synthesize
sr=sample_rate,
UnboundLocalError: local variable 'sample_rate' referenced before assignment

@zhzLuke96 zhzLuke96 added the bug Something isn't working label Jun 14, 2024
@zhzLuke96 zhzLuke96 self-assigned this Jun 14, 2024
@zhzLuke96
Copy link
Member

fixed 1566f88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants