Closed moha6767 closed 3 months ago
f0_file=None
f0_file=None
Please tell me 1:1 what i have to do because i don’t know anything about python i am literally lost…. i would appreciate that really much.
Using Gradio as a CLI is horrible, Applio is not designed for it. Try this https://github.com/blaisewf/rvc-cli/
also RVC doesn’t work…
I've written a Python script that is supposed to convert text files into audio files using the RVC-CLI command for speech synthesis. The script runs without errors, and the CMD output confirms that the audio processing was successful. However, I can't find any audio files in the specified output folder.
Here's the code:
import subprocess
import os
def run_rvc_cli(text, output_tts_path, output_rvc_path, model_path, index_path, tts_voice="es-ES"):
"""Executes the RVC-CLI command for speech synthesis."""
command = [
r"C:\Users\...\AppData\Local\Programs\Python\Python38\python.exe",
r"C:\Users\...\Desktop\rvc-cli-1.2.3\rvc_cli.py",
"tts",
"--tts_text", f'"{text.replace("'", "’")}"',
"--tts_voice", tts_voice,
"--output_tts_path", output_tts_path,
"--output_rvc_path", output_rvc_path,
"--pth_path", model_path,
"--index_path", index_path
]
try:
subprocess.run(command, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
print(f"TTS and RVC successfully executed. Audio file: {output_rvc_path}")
except subprocess.CalledProcessError as e:
print(f"Error executing RVC-CLI: {e.stderr}")
def main():
model_path = r"C:\Users\...\Desktop\rvc-cli-1.2.3\logs\kleiner_e350\kleiner_e350.pth"
index_path = r"C:\Users\...\Desktop\rvc-cli-1.2.3\logs\v2.index\added_IVF1346_Flat_nprobe_1_v2.index"
output_directory = r"C:\Users\...\Desktop\Output Audio"
input_directory = r"C:\Users\...\Desktop\Output Scripts"
# Create the output directory if it doesn't exist
os.makedirs(output_directory, exist_ok=True)
# Read all text files from the input directory
text_files = [f for f in os.listdir(input_directory) if f.endswith('.txt')]
for i, text_file in enumerate(text_files):
with open(os.path.join(input_directory, text_file), 'r', encoding='utf-8') as file:
text = file.read()
output_tts_file = os.path.join(output_directory, f"tts_output_{i}.wav") # Temporary TTS file
output_rvc_file = os.path.join(output_directory, f"rvc_output_{i}.wav")
# Convert text to string and escape quotation marks
escaped_text = f'"{text.replace("'", "’")}"'
run_rvc_cli(escaped_text, output_tts_file, output_rvc_file, model_path, index_path)
print(f"TTS and RVC for file {text_file} completed: {output_rvc_file}")
if __name__ == "__main__":
main()
CMD indicates that the script was successfully executed and that the audio files were created. However, the files are not found in the target folder.
Hello everyone,
I'm hoping you can help me with a problem I've encountered while trying to automate a process using a Python script I wrote. The goal is to create a script that automatically takes text files from one folder, converts them into audio files using Text-to-Speech, and then saves the completed audio files into a different folder. Unfortunately, I keep getting error messages when I run the script, and I'm getting quite frustrated because I can't seem to find a solution.
Here is the script I'm using:
However, I keep getting the following error message when I run the script:
I've tried adjusting various parts of the script, but I keep running into the same issue. It seems like the
f0_file
argument is missing a value, but I'm not sure how to configure it correctly or where exactly the problem lies.Has anyone here had experience with similar Text-to-Speech scripts or using Applio? I would greatly appreciate any help or tips on how to resolve this issue.
If it's relevant: I'm running the script locally on my computer and have embedded all the necessary paths in the code. I can provide more details about the setup or code if that would help narrow down the problem.
Thanks in advance for your support!
Best regards