微信扫码
添加专属顾问
我要投稿
import ChatTTSfrom IPython.display import Audiochat = ChatTTS.Chat()chat.load_models(compile=False) # Set to True for better performancetexts = ["PUT YOUR TEXT HERE",]wavs = chat.infer(texts, )torchaudio.save("output1.wav", torch.from_numpy(wavs[0]), 24000)
#################################### Sample a speaker from Gaussian.rand_spk = chat.sample_random_speaker()params_infer_code = {'spk_emb': rand_spk, # add sampled speaker'temperature': .3, # using custom temperature'top_P': 0.7, # top P decode'top_K': 20, # top K decode}#################################### For sentence level manual control.# use oral_(0-9), laugh_(0-2), break_(0-7)# to generate special token in text to synthesize.params_refine_text = {'prompt': '[oral_2][laugh_0][break_6]'}wav = chat.infer(texts, params_refine_text=params_refine_text, params_infer_code=params_infer_code)#################################### For word level manual control.text = 'What is [uv_break]your favorite english food?[laugh][lbreak]'wav = chat.infer(text, skip_refine_text=True, params_refine_text=params_refine_text, params_infer_code=params_infer_code)torchaudio.save("output2.wav", torch.from_numpy(wavs[0]), 24000)https://colab.research.google.com/github/Kedreamix/ChatTTS/blob/main/ChatTTS_infer.ipynb#scrollTo=_xrONBIj9oxo
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费场景POC验证,效果验证后签署服务协议。零风险落地应用大模型,已交付160+中大型企业
2025-04-04
Claude教育版正式发布!全球顶尖高校联手打造,开启AI辅助教学新时代
2025-04-04
微信读书MCP Server:当AI遇上你的私人图书馆,智能阅读时代开启!
2025-04-04
下一个香饽饽岗位-AI 运营负责人【布哥AI早餐20250404】
2025-04-02
苹果AI中文版上线了
2025-04-02
生成式AI时代的内容营销,再聊SEO/AEO
2025-04-02
这 46 条 AI 真相,就是这些天让大佬们彻夜难眠的原因
2025-04-01
AI应用没有壁垒,朱啸虎可能还真说对了
2025-04-01
LLM 驱动前端创新:AI 赋能营销合规实践
2024-12-25
2024-07-20
2024-11-06
2024-08-13
2024-07-18
2024-11-02
2024-07-25
2024-12-25
2024-09-06
2024-07-24