import gradio as gr def identity(audio): return audio, audio def enable_button(): return gr.Button(interactive=True) with gr.Blocks() as demo: with gr.Row(): with gr.Column(): audio_in = gr.Audio(sources=["microphone"], type="filepath") run_button = gr.Button("Generate audio", interactive=False) # Start with the button disabled with gr.Column(): audio_out = gr.Audio(type="filepath") path_out = gr.Textbox(label="audio filepath") # Enable the button on upload audio.upload(fn=enable_button, outputs=button) run_button.click(fn=identity, inputs=[audio_in], outputs=[audio_out, path_out]) demo.launch()