You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changing the VC model via API doesn't work, however, changing the speaker does. Is there any way to generate TTS without the Gradio API? or could you please provide some *.py use case examples? tysm.
The text was updated successfully, but these errors were encountered:
Hey, I managed with a lot of trial and error to create a python script to generate TTS messages from one program to another one.
Since the APIs arent named its required to use the fn_index (function index).
This is my very basic .py script but it works.
It always runs the SetLang fucntion first because the generating of Text To Speech fails unless a language model is set first
The way I use the script is that I removed the SetLang() and GenTTS() from the bottom and just imported my script into another program to just call the functions individually controlling the logic from there instead. It works well changing the loaded models and speakers from the other script.
The fn_index=X at the bottom of the functions just define that it wants to use that specific endpoint. I'm sure there is a way to name the endpoints in the original code but i have close to 0 experience with Gradio so I wouldnt know how. Hope this helps!
from gradio_client import Client
def SetLang():
client = Client("http://127.0.0.1:7860/")
result = client.predict(
"en", # str (Option from: ['en', 'ja']) in 'Languages' Dropdown component
fn_index=0
)
print(result)
def GenTTS(lang="en", msg="test msg", speaker="speaker14", conv="No conversion", pitch=0,method="harvest",speed=1):
client = Client("http://127.0.0.1:7860/")
result = client.predict(
lang, # str (Option from: ['en', 'ja']) in 'Languages' Dropdown component
msg, # str in 'Text' Textbox component
speaker, # str (Option from: []) in 'Speaker' Dropdown component
conv, # str (Option from: ['No conversion', 'Forsen', 'ForsenRVC1']) in 'Voice Conversion' Dropdown component
pitch, # int | float (numeric value between -12 and 12) in 'Pitch' Slider component
method, # str in 'Pitch Method pm: speed-oriented, harvest: accuracy-oriented' Radio component
speed, # int | float (numeric value between 0.1 and 2) in 'Speed' Slider component
fn_index=3
)
return(result[1])
SetLang()
print(GenTTS())
Changing the VC model via API doesn't work, however, changing the speaker does. Is there any way to generate TTS without the Gradio API? or could you please provide some *.py use case examples? tysm.
The text was updated successfully, but these errors were encountered: