Skip to main content

TTS-with-RVC 0.1.10

TTS-with-RVC (Text-to-Speech with RVC) is a package designed to enhance the capabilities of text-to-speech (TTS) systems by introducing a RVC module. The package enables users to not only convert text into speech but also personalize and customize the voice output according to their preferences with RVC support.

PyTorch is required. CUDA or MPS can accelerate inference; CPU is also supported.

It may contain bugs. Report an issue in case of error.

Release notes

0.1.10 - September 30, 2026: Added MultiGPU support: run independent instances on different GPUs in the same process. Separate model/runtime state per instance, explicit GPU selection, automatic precision, async usage with generate_async(), and resource cleanup with close() / context managers.

0.1.9 - March 31, 2025: Some small fixes, fixed fairseq installation for linux.

0.1.8 - March 30, 2025: Added all RVC parameters, implemented FCPE support, added PyPI installation support, fixed bug with rmvpe-only f0 method.

0.1.6 - March 28, 2025: Updated all files with the latest RVC commit - 1.5-2x times faster inference. Reduced required packages. ONNX support here.

0.1.5 - February 21, 2025: Removed all unnecessary packages, Removed rvc_path, Added f0_method for more control.

0.1.4 - November 22, 2024: Added index_path and index_rate parameters for more control over index-based voice conversion.

0.1.3 - fixed a lot problems, some optimization.

Prerequisites

You must have Python 3.10, 3.11 or 3.12 installed.

You must have CUDA or MPS support for your GPU (mps is not tested yet). Otherwise it will use CPU, which is very slow.

Installation

  1. Install pytorch with CUDA or MPS support here: https://pytorch.org/get-started/locally/

  2. Then, install TTS-with-RVC using pip install:

pip install tts-with-rvc
  1. And finally, install ffmpeg if you don't already have one, and add it to the folder with your script or better yet add ffmpeg to the Environment variables in Path.

How it Works

  1. Text-to-Speech (TTS): Users enter text into the TTS module, which then processes it and generates the corresponding speech as a file saved in the temp directory
  2. RVC: With .pth file provided, RVC module reads the generated audio file, processes it and generates an new audio saved in output_directory with voice replaced.

Usage

TTS-with-RVC has a class called TTS_RVC. There are a few parameters that are required:

model_path - path to your .pth model

And optional parameters:

voice - voice from edge-tts list (default is "ru-RU-DmitryNeural")

device - set device ("cpu", "cuda:N", "mps"; with None, selects CUDA, then MPS, then CPU)

tmp_directory - path to TTS input directory (Temp directory for saving TTS output, default is Temp folder)

output_directory - directory for saving voiced audio (temp/ is default).

index_path - path to the file index for voice model adjustments (default is empty string "").

index_rate - blending rate between original and indexed voice conversion (default is 0.75).

f0_method - method for calculating the pitch of the audio (default is rmvpe). Available: 'rmvpe', 'fcpe' (fp32 only), 'pm', 'harvest', 'dio', 'crepe'.

Deprecated:

input_directory - path to TTS input directory (Temp directory for saving TTS output, default is None)

To set the voice, firstly, make instance of TTS_RVC:

from tts_with_rvc import TTS_RVC

tts = TTS_RVC(model_path="models\\YourModel.pth",
                index_path="logs\\YourIndex.index",
                f0_method="rmvpe")

All voices available placed in voices.txt file:

Voice discovery is available as the async module-level function get_voices() from tts_with_rvc.

Next, set the voice for TTS with tts.set_voice() function:

tts.set_voice("un-Un-SelectedNeural")

Setting the appropriate language is necessary if you are using other languages for voiceovers!

And final step is calling tts to replace voice:

path = tts(text="Привет, мир!", pitch=6, index_rate=0.50)

Parameters:

text - text for TTS (required)

pitch - pitch change (transpose) for RVC in semitones (optional, neg. values are compatible, default is 0)

tts_rate - extra rate of speech for Edge TTS in percentage (+-) (optional, neg. values are compatible, default is 0)

tts_volume - extra volume of speech for Edge TTS in percentage (+-) (optional, neg. values are compatible, default is 0)

tts_pitch - extra pitch of TTS-generated audio in Hz (+-) (optional, neg. values are compatible, not recommended, default is 0)

output_filename - name for the output file (optional, default is None, a unique name is generated)

index_rate - blending rate between original and indexed voice conversion (0 to 1) (optional, default is 0.75).

is_half - Precision override: True for FP16, False for FP32, or None for the instance's automatic precision policy. CPU FP16 is rejected.

f0method - F0 extraction method for this specific call, overrides the instance default: 'rmvpe', 'fcpe' (fp32 only), 'pm', 'harvest', 'dio', 'crepe'. (optional, default uses instance setting).

file_index2 - Path to secondary index file for RVC. (optional, default is empty string "").

filter_radius - Median filter radius for pitch results. Values >=3 reduce breathiness. (optional, default is 3).

resample_sr - Sample rate to resample audio to before RVC. 0 means no resampling. (optional, default is 0).

rms_mix_rate - Volume envelope scaling (0-1). Lower values mimic original volume more closely. (optional, default is 0.5).

protect - Protection for voiceless consonants and breaths (0-1). Lower values increase protection. 0.5 disables. (optional, default is 0.33).

verbose - Enable verbose logging for RVC conversion. (optional, default is False).

Example of usage

A simple example for voicing text:

from tts_with_rvc import TTS_RVC
from playsound import playsound

tts = TTS_RVC(
    model_path="models\\DenVot13800.pth",
    index_path="logs\\added_IVF1749_Flat_nprobe_1.index"
)

tts.set_voice("ru-RU-DmitryNeural")
path = tts(text="Привет, мир!", pitch=6, index_rate=0.9)

# Normalize path for playsound if needed (example)
# path = path.replace("\\\\", "/").replace("\\","/")

playsound(path)

New usage (0.1.10)

MultiGPU

Create one instance per GPU. Each instance owns its model state; distribute requests between them in your application.

from concurrent.futures import ThreadPoolExecutor
from tts_with_rvc import TTS_RVC

with TTS_RVC(
    model_path="models/voice.pth", device="cuda:0", output_directory="output/gpu0",
) as first, TTS_RVC(
    model_path="models/voice.pth", device="cuda:1", output_directory="output/gpu1",
) as second:
    with ThreadPoolExecutor(max_workers=2) as pool:
        jobs = [
            pool.submit(first, "First request."),
            pool.submit(second, "Second request."),
        ]
        output_paths = [job.result() for job in jobs]
        print(output_paths)

A bare cuda selects GPU zero. Use separate instances for parallel conversion; each converter serializes its own conversion calls.

Async applications

import asyncio
from tts_with_rvc import TTS_RVC

async def main():
    with TTS_RVC(model_path="models/voice.pth", device="cuda:0") as tts:
        path = await tts.generate_async("Hello, world!")
        print(path)

asyncio.run(main())

Changing settings and releasing resources

tts.set_model(path) changes the RVC voice model. Use tts.device = "cuda:1" to change the device. You can direct auxiliary model downloads to models_dir in the constructor. A with block closes the instance automatically; otherwise call tts.close() when finished.

Text parameters

There are some text parameters processor for integration issues such as adding GPT module.

You can process them using process_args in TTS_RVC class:

--tts-rate (value) - TTS parameter to edit the speech rate (negative value for decreasing rate and positive value for increasing rate)

--tts-volume (value) - TTS parameter to edit the speech volume (negative value for decreasing volume and positive value for increasing volume) Seems to not work because of the RVC module conversion.

--tts-pitch (value) - TTS parameter to edit the pitch of TTS generated audio (negative value for decreasing pitch and positive value for increasing pitch) I do not recommend using this because the RVC module has its own pitch for output.

--rvc-pitch (value) - RVC parameter to edit the pitch of the output audio (negative value for decreasing pitch and positive value for increasing pitch)

Now the principle of work:

from tts_with_rvc import TTS_RVC

tts = TTS_RVC(model_path="models\\YourModel.pth")

# This method returns arguments and original text without these text parameters
args, message = tts.process_args(message)

The args variable contains an array with the following structure:

args[0] - TTS Rate

args[1] - TTS Volume

args[2] - TTS Pitch

args[3] - RVC pitch

And now we are ready to use it for generation:

path = tts(message, tts_rate=args[0],
                    tts_volume=args[1],
                    tts_pitch=args[2],
                    pitch=args[3])

Methods

set_index_path(index_path) - updates the path to the index file for voice model adjustments.

voiceover_file(path, filename="converted.wav") - converts existing audio without TTS.

set_precision(None) restores automatic precision; pass False to select FP32.

Exceptions

  1. DeviceResolutionError: the requested device is unavailable. Check the GPU index and your PyTorch installation.

  2. RuntimeError: RuntimeError: Failed to load audio: {e}

Be sure you installed ffmpeg.

Acknowledgements

RVC Project - for RVC

License

MIT License

Authors

Atm4x (Artem Dikarev)

Metadata

Release files for tts-with-rvc 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tts-with-rvc 0.1.10
File Size Uploaded
tts_with_rvc-0.1.10.tar.gz 63.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tts-with-rvc 0.1.10
File Interpreter ABI Platform
tts_with_rvc-0.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 131.6 kB

Release files / tts_with_rvc-0.1.10.tar.gz

Download URL tts_with_rvc-0.1.10.tar.gz
Size 63.5 kB
Tags Source
SHA-256 checksum
How to use checksums
decb6f2f890548ed44ea4760cf90157d86b53736cf3262c79683934ce274194d
BLAKE2b-256 checksum
How to use checksums
64f7f6b7dbc978e9576222fc1180c480be99271fb7b5339c6d3440b28ef2f6dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / tts_with_rvc-0.1.10-py3-none-any.whl

Download URL tts_with_rvc-0.1.10-py3-none-any.whl
Size 68.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c92e9e1acb28f5f8ade29191e5d71beb4e26e27c1770b34be57e16f6a2efa799
BLAKE2b-256 checksum
How to use checksums
6b4100b415a2827c9045aa22afe5327541434188253c47b26d6a6c03d9a5e8f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.1.10 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page