Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

low speaker similarity in zero-shot tts #910

Open
LoganLiu66 opened this issue Mar 3, 2025 · 1 comment
Open

low speaker similarity in zero-shot tts #910

LoganLiu66 opened this issue Mar 3, 2025 · 1 comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@LoganLiu66
Copy link

LoganLiu66 commented Mar 3, 2025

Thank you for this great job. When I try to use zero-shot TTS, I found speakers' similarity is low between spk_smp and generated aduio. My prompt audio、prompt_text and generated audio are in audios.zip. What may be the reason for causing this, and is there any advice for improvement, thanks.

    audio_file = 'sample.wav'
    prompt_text = 'I chance to leave him alone, but[uv_break] no[uv_break]. She just wanted to see him again[uv_break]. Anna[uv_break], you don't know how it feels to lose a sister[uv_break].'
    spk_smp = chat.sample_audio_speaker(load_audio(audio_file, 24000))

    params_infer_code = ChatTTS.Chat.InferCodeParams(
        spk_smp=spk_smp,
        txt_smp=prompt_text,
        temperature=0.3,
        top_P=0.7,
        top_K=20
    )
    params_refine_text = ChatTTS.Chat.RefineTextParams(
        prompt='[oral_5]'
    )

    text = "I do love books, but I think I like writing about them more than selling them."
    wav = chat.infer(
        text,
        params_infer_code=params_infer_code,
        split_text=False,
        params_refine_text=params_refine_text
    )
    torchaudio.save("sample_generated.wav", torch.from_numpy(wav[0]).unsqueeze(0), 24000)
@fumiama fumiama added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Mar 12, 2025
@fumiama
Copy link
Member

fumiama commented Mar 12, 2025

ZeroShot works best on the audio generated by ChatTTS. If you want to use outside audio, make sure that the audio has good quality and the transcript, txt_smp, is completely identical to the audio, including [lbreak] mark, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants