File size: 668 Bytes
fbaa78b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

import gradio as gr

def process_audio(audio):
    """
    Dummy processing function.
    In a real app, you could process the audio (e.g., transcribe it) before returning it.
    Returning the input audio here allows it to be downloaded by the user.
    """
    return audio

# Create the Gradio interface
iface = gr.Interface(
    fn=process_audio,
    inputs=gr.Audio(sources="microphone", type="numpy", label="Record your speech"),
    outputs=gr.Audio(label="Your recorded speech"),
    title="Audio Recorder",
    description="Click the button below to record your speech. You can download the recording after it's processed."
)

# Launch the app
iface.launch()