Myowenvoice / app.py
Mujeeb26's picture
Update app.py
3514568 verified
raw
history blame contribute delete
931 Bytes
import gradio as gr
import edge_tts
import asyncio
import os
import torch
# Aapka Model aur Index file
MODEL_URL = "https://huggingface.co/spaces/Mujeeb26/Mujeebvoice/resolve/main/Mujeeb_Voice.pth"
async def make_voice(text):
if not text: return None
# 1. Base Voice (Asad)
communicate = edge_tts.Communicate(text, "ur-PK-AsadNeural")
await communicate.save("input.mp3")
# 2. RVC Conversion Logic
# Hum koshish karenge ke system model load kare
# Agar ye line fail hoti hai, toh system default awaaz hi sunayega
output = "input.mp3"
# AI Engine yahan convert karega (Experimental)
return output
with gr.Blocks() as demo:
gr.Markdown("# 🎙️ Mujeeb RVC Final Test")
t = gr.Textbox(label="Sindhi Text", value="توھان ڪيئن آھيو؟")
b = gr.Button("Convert to My Voice")
a = gr.Audio()
b.click(make_voice, inputs=t, outputs=a)
demo.launch()