myshell-ai / MeloTTS

High-quality multi-lingual text-to-speech library by MyShell.ai. Support English, Spanish, French, Chinese, Japanese and Korean.
MIT License
4.81k stars 625 forks source link

How can i use voice conversion? #136

Open teedihuni opened 6 months ago

teedihuni commented 6 months ago

Hello, I've attempted to use the voice_conversion function in the SynthesizerTrn class located in model.py. However, I am facing difficulties due to a lack of information on what type of input data should be provided to this function. If anyone has experience with this function, could you please share details on the format and examples of the input data?

In particular, I would greatly appreciate it if you could provide specific examples of the data that should be supplied to the parameters y, y_lengths, sid_src, and sid_tgt.

Thank you!

    def voice_conversion(self, y, y_lengths, sid_src, sid_tgt, tau=1.0):        
        g_src = sid_src
        g_tgt = sid_tgt
        z, m_q, logs_q, y_mask = self.enc_q(y, y_lengths, g=g_src, tau=tau)
        z_p = self.flow(z, y_mask, g=g_src)
        z_hat = self.flow(z_p, y_mask, g=g_tgt, reverse=True)
        o_hat = self.dec(z_hat * y_mask, g=g_tgt)
        return o_hat, y_mask, (z, z_p, z_hat)
RedBluePrinter commented 5 months ago

I think MeloTTS does not have voice conversation yet. OpenVoice had it but MeloTTS still does not support it yet! (I Could be wrong here)