Spaces:
Runtime error
Runtime error
File size: 1,062 Bytes
7d2cbf0 6109e78 7d2cbf0 6109e78 1ecfea6 25b6136 8becdbe 25b6136 6109e78 b652a3a 25b6136 8becdbe b652a3a 7d2cbf0 990e572 8a33021 6109e78 7d2cbf0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import gradio as gr
import subprocess
def dem(audio):
print(type(audio))
print(audio)
sr,y = audio
print(f"Speech rate:{sr} and audio : {y}")
command = r"""wine './whisper_blas_bin_v1_3_0/main.exe' -h"""
command2 = """chmod +777 ./whisper_blas_bin_v1_3_0/main.exe"""
wine_command = """sudo apt-get install wine"""
wine_c = subprocess.run(wine_command,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, text=True)
perm = subprocess.run(command2, shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, text=True)
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
print("Output: \n",result.stdout)
print("Error: \n",result.stderr)
print("permission :",perm)
print("Wine :",wine_c)
return audio,result.stdout,result.stderr
demo = gr.Interface(
dem,
inputs="microphone", # returns tuple
# inputs=gr.Audio(sources=["microphone"]), # work return tuple
outputs=["audio","text","text"]
)
demo.launch() |