|
|
|
|
|
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 |
|
|
|
|
|
|
|
|
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." |
|
|
) |
|
|
|
|
|
|
|
|
iface.launch() |