File size: 443 Bytes
1a3282a
68da411
bb8a258
68da411
 
1a3282a
68da411
 
 
 
 
 
1a3282a
68da411
 
1a3282a
68da411
1a3282a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from easytts import EasyTTS

# Initialize the EasyTTS model
tts_model = EasyTTS()

def text_to_speech(text_input):
    # Use EasyTTS to convert text to speech
    audio_data = tts_model.synthesize(text_input)
    
    # Display and play the audio
    gr.output.Audio(audio_data).play()

# Create a Gradio interface
iface = gr.Interface(fn=text_to_speech, inputs="text", outputs=None)

# Launch the interface
iface.launch()