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

还有待提升, 我生成的不知道为什么,后面的就不读了 #760

Open
lihe6666 opened this issue Sep 19, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@lihe6666
Copy link

lihe6666 commented Sep 19, 2024

image
import ChatTTS
import torch
import torchaudio

chat = ChatTTS.Chat()
chat.load(compile=False) # Set to True for better performance

f = open("../frog-tts/demo/w.text", "r", encoding="utf-8")

texts = f.read().replace('\n', '')
f.close()

wavs = chat.infer(texts)

for i in range(len(wavs)):
    """
    In some versions of torchaudio, the first line works but in other versions, so does the second line.
    """
    try:
        torchaudio.save(f"basic_output{i}.wav", torch.from_numpy(wavs[i]).unsqueeze(0), 24000)
    except:
        torchaudio.save(f"basic_output{i}.wav", torch.from_numpy(wavs[i]), 24000)
@fumiama
Copy link
Member

fumiama commented Sep 21, 2024

文字不能太长,30s内为宜。

@fumiama fumiama added the documentation Improvements or additions to documentation label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants