metaambod / app.py
unijoh's picture
Update app.py
67594bc verified
raw
history blame
1.16 kB
import gradio as gr
from asr import transcribe
from tts import synthesize_speech
from lid import identify
def main():
with gr.Blocks() as demo:
gr.Markdown("# Faroese ASR, TTS, and LID Demo")
with gr.Tab("ASR"):
audio_input = gr.Audio(source="microphone", type="filepath")
transcribe_button = gr.Button("Transcribe")
transcribe_output = gr.Textbox()
transcribe_button.click(fn=transcribe, inputs=audio_input, outputs=transcribe_output)
with gr.Tab("TTS"):
text_input = gr.Textbox(label="Text Input")
synthesize_button = gr.Button("Synthesize")
synthesize_output = gr.Audio()
synthesize_button.click(fn=synthesize_speech, inputs=text_input, outputs=synthesize_output)
with gr.Tab("LID"):
audio_input_lid = gr.Audio(source="microphone", type="filepath")
identify_button = gr.Button("Identify Language")
identify_output = gr.Textbox()
identify_button.click(fn=identify, inputs=audio_input_lid, outputs=identify_output)
demo.launch()
if __name__ == "__main__":
main()