Spaces:
Sleeping
Sleeping
import gradio as gr | |
def save_audio(audio): | |
""" | |
This function simply returns the audio file it receives, simulating a save. | |
Gradio handles the recording directly in the browser. | |
""" | |
return audio | |
# Create a Gradio interface for recording audio | |
iface = gr.Interface( | |
fn=save_audio, | |
inputs=gr.Audio(source="microphone", type="filepath"), | |
outputs=gr.Audio(label="Playback Recorded Audio"), | |
title="Simple Browser-Based Voice Recorder", | |
description="Click 'Record' to start recording. Click 'Stop' to end recording. Playback the recording below." | |
) | |
# Run the Gradio app | |
iface.launch() | |