File size: 378 Bytes
51c9eb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from test1 import asr_transcribe
from _utils import audio_to_bytes


def transcribe(audio):
    # convert the audio to bytes 
    audio_bytes = audio_to_bytes(audio)
    transcription = asr_transcribe(audio_bytes)
    # transcribe
    return transcription

demo = gr.Interface(
    transcribe,
    gr.Audio(sources="microphone"),
    "text",
)

demo.launch()