myshell-ai / OpenVoice

Instant voice cloning by MIT and MyShell.
https://research.myshell.ai/open-voice
MIT License
28.08k stars 2.75k forks source link

Is TTS required for voice cloning #144

Open ColorBuffer opened 6 months ago

ColorBuffer commented 6 months ago

hi

is TTS step required to use the model for tone conversion?

I speak in persian and couldn't find a good tts. I just need to convert the tone of my own voice.

First I tested with given example resourses.

it works, but the result is robotic? am I doing something wrong?

import os
import torch
from openvoice import se_extractor
from openvoice.api import ToneColorConverter

ckpt_converter = 'checkpoints/converter'
device="cuda:0" if torch.cuda.is_available() else "cpu"
output_dir = 'outputs'

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)

source_se, audio_name = se_extractor.get_se('resources/demo_speaker0.mp3', tone_color_converter, target_dir='processed_s', vad=True)
target_se, audio_name = se_extractor.get_se('resources/demo_speaker2.mp3', tone_color_converter, target_dir='processed_t', vad=True)

# Run the tone color converter
encode_message = "@MyShell"
tone_color_converter.convert(
    audio_src_path='resources/demo_speaker0.mp3', 
    src_se=source_se, 
    tgt_se=target_se, 
    output_path=f'{output_dir}/ok.wav',
    message=encode_message)
Zengyi-Qin commented 6 months ago

The usage is correct, but not speakers are suitable for being used as base speakers, which is the source speaker demo_speaker0.mp3. We found that young to mid-age female voices work better as base speaker

iamchenxin commented 4 months ago

It seems that the training is based on female voices. Putting a male voice into audio_src is basically completely unrecognizable.