Spaces:
Runtime error
Runtime error
import os | |
import numpy as np | |
import gradio as gr | |
print("here") | |
# import subprocess | |
# def get_ffmpeg_version(): | |
# output = subprocess.check_output(['ffmpeg', '-version'], stderr=subprocess.STDOUT) | |
# output = output.decode('utf-8') # Convert bytes to string | |
# return output | |
# print(get_ffmpeg_version()) | |
def handle_audio(audio): | |
sr, y = audio | |
return sr, y.shape, audio | |
with gr.Blocks() as demo: | |
with gr.Column(variant="panel"): | |
a1 = gr.Audio(source="microphone", type="numpy") | |
up1 = gr.Button() | |
with gr.Row(): | |
sr1 = gr.Textbox(label="sr") | |
len1 = gr.Textbox(label="len") | |
a1out = gr.Audio() | |
up1.click(handle_audio, a1, [sr1, len1, a1out]) | |
with gr.Column(variant="panel"): | |
a2 = gr.Audio(source="upload", type="numpy") | |
up2 = gr.Button() | |
with gr.Row(): | |
sr2 = gr.Textbox(label="sr") | |
len2 = gr.Textbox(label="len") | |
a2out = gr.Audio() | |
up2.click(handle_audio, a2, [sr2, len2, a2out]) | |
# if __name__ == "__main__": | |
demo.queue().launch() | |