Install OpenVoice v2 Locally - Instantly Clone Voice with AI

Version 2.8 von René Schmidt am 2025/03/10 20:02

conda create -n openvoice python=3.9
conda activate openvoice

git clone https://github.com/myshell-ai/openVoice.git

 cd openVoice
 pip install -e .
 mkdir checkpoints_v2
 cd checkpoints_v2
 wget https://myshell-public-repo-host.s3.amazonaws.com/openvoice/checkpoints_v2_0417.zip

unzip checkpoints_v2_0417.zip

mv checkpoints_v2 ~/OpenVoice

pip install git+https://github.com/cocktailpeanut/ov2.git

 cd ..
 pip install git+https://github.com/myshell-ai/MeloTTS.git
 python -m unidic download
 cd resources
 python3

import os

import torch

from openvoice import se_extractor

from openvoice.api import ToneColorConverter

ckpt_converter = 'checkpoints_v2/converter'

device = "cuda:0" if torch.cuda.is_available() else "cpu"

output_dir = 'outputs_v2'

tone_color_converter = ToneColorConverter(f' {ckpt_converter} /config.json', device=device)

tone_color_converter.load_ckpt(f' {ckpt_converter} /checkpoint.pth')

os.makedirs (output_dir, exist_ok=True)

reference_speaker = 'resources/example_reference.mp3'

target_se, audio_name = se_extractor.get_se(reference_speaker, tone_color_converter, vad=False)

from melo.api import TTS

src_path = f' {output_dir} /tmp.wav'

speed = 1.0