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
-
Install pytorch with CUDA or MPS support here: https://pytorch.org/get-started/locally/
-
Then, install TTS-with-RVC using pip install:
pip install tts-with-rvc
- 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 variablesinPath.
How it Works
- 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
- 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
-
DeviceResolutionError: the requested device is unavailable. Check the GPU index and your PyTorch installation. -
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tts_with_rvc-0.1.10.1.tar.gz | 63.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tts_with_rvc-0.1.10.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 131.7 kB
Release files / tts_with_rvc-0.1.10.1.tar.gz
| Download URL | tts_with_rvc-0.1.10.1.tar.gz |
|---|---|
| Size | 63.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92e799c04509416f9974fad0ba863b6d08be694582a298052fbe18f4e72045f8
|
|
BLAKE2b-256 checksum How to use checksums |
c03d743e3118b7ec945a0d0f94d6eebc86b4142aff9ea07c0a64c0aa9195cd3a
|
| 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.1-py3-none-any.whl
| Download URL | tts_with_rvc-0.1.10.1-py3-none-any.whl |
|---|---|
| Size | 68.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
052941b33d12bc5818751d7a4834506a28a3534d6e9068716812351b169f85e2
|
|
BLAKE2b-256 checksum How to use checksums |
883584447b5aa76349ef6fab880fdb5514c276daccfbdacb6a4898402edae755
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|