Version 2.5 by René Schmidt on 2025/03/10 18:23

Hide last authors
René Schmidt 2.1 1 conda create -nopenvoice python=3.9
2 conda activate openvoice
3
4
5 git clone https:~/~/github.com/myshell-ai/openVoice.git
6
7
8
9
10
11 cd openVoice
12 pip install -e .
13 mkdir checkpoints_v2
14 cd checkpoints_v2
15 wget [[https:~~/~~/myshell-public-repo-host.s3.amazonaws.com/openvoice/checkpoints_v2_0417.zip>>https://myshell-public-repo-host.s3.amazonaws.com/openvoice/checkpoints_v2_0417.zip]]
16
17 unzip checkpoints_v2_0417.zip
18
19
20 mv checkpoints_v2 ~~/openVoice
21
22
23
24
25
26
27 pip install git+https:~/~/github.com/cocktailpeanut/ov2.git
28
29
30
31 cd ..
32 pip install git+https:~/~/github.com/myshell-ai/MeloTTS.git
33 python -m unidic download
34 cd resources
35 python3
36
37
38
René Schmidt 1.1 39 import os
40
41 import torch
42
43 from openvoice import se_extractor
44
45 from openvoice.api import ToneColorConverter
46
47 ckpt_converter = 'checkpoints_v2/converter'
48
49 device = "cuda:0" if torch.cuda.is_available() else "cpu"
50
51 output_dir = 'outputs_v2'
52
René Schmidt 2.2 53 tone_color_converter = ToneColorCOnverter(f' {ckpt_converter} /config.json', device=device)
René Schmidt 2.3 54
55 tone_color_converter.load_ckpt(f' {ckpt_converter} /checkpoint.pth')
56
57 os.makedirs (output_dir, exist_ok=True)
58
59 reference_speaker = 'resources/example_reference.mp3'
60
René Schmidt 2.4 61 target_se, audio_name = se_extractor.get_se(reference_speaker, tone_color_converter, vad=False)
62
63 from melo.api import TTS
64
65 src_path = f' {output_dir} /tmp.wav'
66
67 speed = 1.0
68
69
70
71
René Schmidt 2.3 72

Applications

Need help?

If you need help with XWiki you can contact: