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

如何保存和调用自定义VoiceID? #918

Open
bugriver opened this issue Jan 21, 2025 · 3 comments
Open

如何保存和调用自定义VoiceID? #918

bugriver opened this issue Jan 21, 2025 · 3 comments

Comments

@bugriver
Copy link

我最近开始使用CosyVoice2,首先非常感谢你们提供了这样强大的工具!目前我遇到了一些问题,希望能得到你们的帮助。

我想要创建和保存一个自定义的VoiceID,比如通过一段音频创建某个人物的声音特性,并将其保存下来,以便后续无需再次提供音频即可调用。请问这个功能是否已经实现?如果是的话,有没有相关的操作指导?

如果创建了VoiceID,应该如何调用它?比如是否可以通过API或其他配置直接指定某个VoiceID进行语音生成?

非常感谢你们的工作,也感谢抽时间回答我的问题!如果有相关文档或示例链接,也请告知我,非常感谢!

@ZzMLvzZ-792998470
Copy link

可以试下看零样本复刻的代码,拿到音色相关的数据,用torch.save方法保存到本地

@bugriver
Copy link
Author

可以试下看零样本复刻的代码,拿到音色相关的数据,用torch.save方法保存到本地

可否指路一下?哪边有这样的实例?

@huyyxy
Copy link

huyyxy commented Jan 23, 2025

参考:
#604

关键代码:
data = load_spk_from_wav(prompt_wav_upload, cosyvoice)
torch.save(data, f'speakers/{spk_name}.pt')

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

3 participants