Download app.py from firengiz/ses: direct link, hf CLI and curl.
- Browser
- Download file 549 Bytes
-
https://huggingface.co/spaces/firengiz/ses/resolve/main/app.py
- Command line
-
hf download hf://spaces/firengiz/ses/app.py
-
curl -L -o app.py https://huggingface.co/spaces/firengiz/ses/resolve/main/app.py
549 Bytes
| import gradio as gr | |
| from gtts import gTTS | |
| import IPython.display as ipd | |
| def generate_and_play_audio(text_input): | |
| # Metni Hugging Face TTS modeli ile işleyin | |
| tts = gTTS(text=text_input, lang='en') | |
| tts.save("output.mp3") | |
| # Ses dosyasını çal | |
| ipd.Audio("output.mp3") | |
| # Gradio arayüzünü tanımlayın | |
| iface = gr.Interface( | |
| fn=generate_and_play_audio, # Kullanılacak fonksiyon | |
| inputs=gr.Textbox(), # Metin girişi | |
| outputs="audio" # Ses çıkışı | |
| ) | |
| # Uygulamayı başlatın | |
| iface.launch() | |