Home
Softono
c

corentinj

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
2

Software by corentinj

Real-Time-Voice-Cloning
Open Source

Real-Time-Voice-Cloning

# Real-Time Voice Cloning This repository is an implementation of [Transfer Learning from Speaker Verification to Multispeaker Text-To-Speech Synthesis](https://arxiv.org/pdf/1806.04558.pdf) (SV2TTS) with a vocoder that works in real-time. This was my [master's thesis](https://matheo.uliege.be/handle/2268.2/6801). 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](https://i.imgur.com/8lFUlgz.png)](https://www.youtube.com/watch?v=-O_hYhToKoA) ### Papers implemented | URL | Designation | Title | Implementation source | | ------------------------------------------------------ | ---------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------- | | [**1806.04558**](https://arxiv.org/pdf/1806.04558.pdf) | **SV2TTS** | **Transfer Learning from Speaker Verification to Multispeaker Text-To-Speech Synthesis** | This repo | | [1802.08435](https://arxiv.org/pdf/1802.08435.pdf) | WaveRNN (vocoder) | Efficient Neural Audio Synthesis | [fatchord/WaveRNN](https://github.com/fatchord/WaveRNN) | | [1703.10135](https://arxiv.org/pdf/1703.10135.pdf) | Tacotron (synthesizer) | Tacotron: Towards End-to-End Speech Synthesis | [fatchord/WaveRNN](https://github.com/fatchord/WaveRNN) | | [1710.10467](https://arxiv.org/pdf/1710.10467.pdf) | GE2E (encoder) | Generalized End-To-End Loss for Speaker Verification | This 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](https://paperswithcode.com/task/speech-synthesis/) for other repositories and recent research in the field of speech synthesis. - Check out [Chatterbox](https://github.com/resemble-ai/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](https://ffmpeg.org/download.html#get-packages). This is necessary for reading audio files. Check if it's installed by running in a command line ``` ffmpeg ``` 2. 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 ``` 3. 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](https://github.com/CorentinJ/Real-Time-Voice-Cloning/issues) 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](https://huggingface.co/CorentinJ/SV2TTS/tree/main). ### (Optional) Download Datasets For playing with the toolbox alone, I only recommend downloading [`LibriSpeech/train-clean-100`](https://www.openslr.org/resources/12/train-clean-100.tar.gz). 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](https://github.com/CorentinJ/Real-Time-Voice-Cloning/wiki/Training#datasets). 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.

ML Frameworks Audio Editing & DAW
59.9K Github Stars
TorchStream
Open Source

TorchStream

# TorchStream TorchStream is a library to help ML developers stream PyTorch models **without retraining nor rewriting them**, in order to reduce their latency or use them in live applications. TorchStream comes with [a website of live examples](https://torchstream.cjemine.xyz/). ## Installation Install as a package (any OS, CUDA optional): ```bash (uv) pip install torchstream-lib ``` Install as a project, to run the streamlit examples yourself (set "--extra cpu" for a cpu only install): ```bash git clone https://github.com/CorentinJ/TorchStream cd TorchStream uv run --group demos streamlit run examples --extra cuda ``` If you don't have `uv` yet: ```bash # 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 ``` ## Overview TorchStream offers a set of tools to help you stream complex neural networks and other sequence to sequence transforms. The example below requires cloning the project and installing the demos dependencies (`uv sync --group demos`). It streams BigVGAN, a state of the art neural vocoder: ```python import logging import librosa import torch from examples.resources.bigvgan.bigvgan import BigVGAN from examples.resources.bigvgan.meldataset import get_mel_spectrogram from torchstream import SeqSpec, SlidingWindowStream, find_sliding_window_params logging.basicConfig(level=logging.INFO) device = "cuda" if torch.cuda.is_available() else "cpu" model = BigVGAN.from_pretrained("nvidia/bigvgan_v2_24khz_100band_256x").eval().to(device) model.remove_weight_norm() # Get a sample mel spectrogram input wave, sample_rate = librosa.load(librosa.ex("libri1"), sr=model.h.sampling_rate) mel = get_mel_spectrogram(torch.from_numpy(wave).unsqueeze(0), model.h).to(device) # Specify the model's input format: a melspectrogram in_spec = SeqSpec(1, model.h.num_mels, -1, device=device) # Output format: an audio waveform out_spec = SeqSpec(1, 1, -1, device=device) # Use TorchStream's solver to find the sliding window parameters of BigVGAN sli_params = find_sliding_window_params( trsfm=model, in_spec=in_spec, out_spec=out_spec, max_in_out_seq_size=1_000_000, )[0] # Perform streaming inference stream = SlidingWindowStream(model, sli_params, in_spec, out_spec) for audio_chunk in stream.forward_in_chunks_iter(mel, chunk_size=80): print(f"Got a {tuple(audio_chunk.shapes[0])} shaped audio chunk") ``` ## Disclaimer TorchStream is developed by myself. It is not affiliated with, endorsed by, or sponsored by the PyTorch team or Meta.

AI & Machine Learning ML Frameworks
67 Github Stars