File size: 1,158 Bytes
382e37a
ff3a5da
2244bbb
a7f185d
2244bbb
 
a7f185d
 
94780f8
a7f185d
2b96c49
 
 
 
382e37a
a7f185d
2b96c49
 
 
 
a7f185d
 
2b96c49
 
 
 
382e37a
2244bbb
 
 
 
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
28
29
30
31
32
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()