Real-Time-Voice-Cloning

CorentinJ更新放缓

用 5 秒语音样本克隆音色,实时合成任意文本的语音,基于 PyTorch/TensorFlow 的说话人编码与声码器流水线。

Clone a voice in 5 seconds to generate arbitrary speech in real-time

暂无版本60,237star +7 / 7 天9,382fork同步于 2026-11-10 17:18 UTC

怎么上手

由 README 提炼,执行前请确认
安装 ffmpeg 并确认 ffmpeg 命令可用;pip install -U uv;uv run --extra cuda demo_toolbox.py(无 NVIDIA GPU 时改用 --extra cpu)
硬件要求按 README 说明

README 说明有 NVIDIA GPU 时用 --extra cuda 运行,无 GPU 时用 --extra cpu 运行,即支持纯 CPU 运行;未给出具体显存或 GPU 型号要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用几秒音频克隆音色,再让任意文本以该音色实时合成语音

用 5 秒语音样本克隆音色,实时合成任意文本的语音,基于 PyTorch/TensorFlow 的说话人编码与声码器流水线。

核心能力

  • 分三阶段实现 SV2TTS:编码器提取说话人嵌入、Tacotron 合成、WaveRNN 声码器
  • 仅需几秒参考音频即可生成说话人数字表示
  • 提供 GUI 工具箱 demo_toolbox.py 与命令行 demo_cli.py 两种用法
  • 用 uv 自动创建虚拟环境并区分 cuda 与 cpu 依赖
  • 预训练模型默认自动下载,也可从 Hugging Face 手动获取

容易踩的坑

必须先安装 ffmpeg,否则无法读取音频文件;首次运行需联网自动下载预训练模型,失败时需从 Hugging Face 手动下载;GPU 与 CPU 依赖需通过 --extra cuda 或 --extra cpu 区分,选错会跑不起来。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Real-Time Voice Cloning

    This repository is an implementation of Transfer Learning from Speaker Verification to Multispeaker Text-To-Speech Synthesis (SV2TTS) with a vocoder that works in real-time. This was my master's thesis.

    SV2TTS is a deep learning framework in three stages. In the first stage, one creates a digital representation of a voice from a few seconds of audio. In the second and third stages, this representation is used as reference to generate speech given arbitrary text.

    Video demonstration (click the picture):

    Toolbox demo

    Papers implemented

    URLDesignationTitleImplementation source
    1806.04558SV2TTSTransfer Learning from Speaker Verification to Multispeaker Text-To-Speech SynthesisThis repo
    1802.08435WaveRNN (vocoder)Efficient Neural Audio Synthesisfatchord/WaveRNN
    1703.10135Tacotron (synthesizer)Tacotron: Towards End-to-End Speech Synthesisfatchord/WaveRNN
    1710.10467GE2E (encoder)Generalized End-To-End Loss for Speaker VerificationThis repo

    Heads up

    Like everything else in Deep Learning, this repo has quickly gotten old. Many SaaS apps (often paying) will give you a better audio quality than this repository will. If you wish for an open-source solution with a high voice quality:

    • Check out paperswithcode for other repositories and recent research in the field of speech synthesis.
    • Check out Chatterbox for a similar project up to date with the 2025 SOTA in voice cloning

    Running the toolbox

    Both Windows and Linux are supported.

    1. Install ffmpeg. This is necessary for reading audio files. Check if it's installed by running in a command line
    ffmpeg
    
    1. Install uv for python package management
    # On Windows:
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    # On Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Alternatively, on any platform if you have pip installed you can do
    pip install -U uv
    
    1. Run one of the following commands
    # Run the toolbox if you have an NVIDIA GPU
    uv run --extra cuda demo_toolbox.py
    # Use this if you don't
    uv run --extra cpu demo_toolbox.py
    
    # Run in command line if you don't want the GUI
    uv run --extra cuda demo_cli.py
    uv run --extra cpu demo_cli.py
    

    Uv will automatically create a .venv directory for you with an appropriate python environment. Open an issue if this fails for you

    (Optional) Download Pretrained Models

    Pretrained models are now downloaded automatically. If this doesn't work for you, you can manually download them from Hugging Face.

    (Optional) Download Datasets

    For playing with the toolbox alone, I only recommend downloading LibriSpeech/train-clean-100. Extract the contents as <datasets_root>/LibriSpeech/train-clean-100 where <datasets_root> is a directory of your choosing. Other datasets are supported in the toolbox, see here. You're free not to download any dataset, but then you will need your own data as audio files or you will have to record it with the toolbox.