mirror of
https://github.com/FunAudioLLM/CosyVoice.git
synced 2026-02-04 09:29:25 +08:00
add vc code
This commit is contained in:
8
webui.py
8
webui.py
@@ -24,6 +24,7 @@ ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.append('{}/third_party/Matcha-TTS'.format(ROOT_DIR))
|
||||
from cosyvoice.cli.cosyvoice import CosyVoice
|
||||
from cosyvoice.utils.file_utils import load_wav, logging
|
||||
from cosyvoice.utils.common import set_all_random_seed
|
||||
|
||||
inference_mode_list = ['预训练音色', '3s极速复刻', '跨语种复刻', '自然语言控制']
|
||||
instruct_dict = {'预训练音色': '1. 选择预训练音色\n2. 点击生成音频按钮',
|
||||
@@ -42,13 +43,6 @@ def generate_seed():
|
||||
}
|
||||
|
||||
|
||||
def set_all_random_seed(seed):
|
||||
random.seed(seed)
|
||||
np.random.seed(seed)
|
||||
torch.manual_seed(seed)
|
||||
torch.cuda.manual_seed_all(seed)
|
||||
|
||||
|
||||
def postprocess(speech, top_db=60, hop_length=220, win_length=440):
|
||||
speech, _ = librosa.effects.trim(
|
||||
speech, top_db=top_db,
|
||||
|
||||
Reference in New Issue
Block a user