File size: 880 Bytes
8e20d62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import gradio as gr
from gradio_client import Client, handle_file

def egyptian_tts(text, speaker_audio, temperature):
    client = Client("MohamedRashad/Egyptian-Arabic-TTS")
    result = client.predict(
        text=text,
        speaker_audio_path=handle_file(speaker_audio),
        temperature=temperature,
        api_name="/infer_EGTTS"
    )
    return result  # ملف الصوت الناتج

iface = gr.Interface(
    fn=egyptian_tts,
    inputs=[
        gr.Textbox(label="النص المراد تحويله إلى صوت"),
        gr.Audio(type="filepath", label="رفع عينة صوتية للمتحدث"),
        gr.Slider(minimum=0.1, maximum=1.0, value=0.75, label="درجة العشوائية")
    ],
    outputs=gr.Audio(label="الصوت الناتج"),
    title="نسخ الصوت بالذكاء الاصطناعي",
    description=""
)

iface.launch()