Pendrokar commited on
Commit
de7f50d
β€’
1 Parent(s): 1cd6967

return audio bytedata to gradio

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -104,12 +104,14 @@ def predict(input, pacing):
104
  response.raise_for_status() # If the response contains an HTTP error status code, raise an exception
105
  except requests.exceptions.RequestException as err:
106
  print('Failed to synthesize!')
 
 
 
107
 
108
- print('server.log contents:')
109
- with open('resources/app/server.log', 'r') as f:
110
- print(f.read())
111
-
112
- return 22100, os.open(save_path, "rb")
113
 
114
  input_textbox = gr.Textbox(
115
  label="Input Text",
@@ -124,7 +126,7 @@ gradio_app = gr.Interface(
124
  input_textbox,
125
  slider
126
  ],
127
- outputs= "audio",
128
  title="xVASynth (WIP)",
129
  )
130
 
 
104
  response.raise_for_status() # If the response contains an HTTP error status code, raise an exception
105
  except requests.exceptions.RequestException as err:
106
  print('Failed to synthesize!')
107
+ print('server.log contents:')
108
+ with open('resources/app/server.log', 'r') as f:
109
+ print(f.read())
110
 
111
+ byte_data = None
112
+ with open(save_path, "rb") as file:
113
+ byte_data = file.read()
114
+ return (22050, byte_data)
 
115
 
116
  input_textbox = gr.Textbox(
117
  label="Input Text",
 
126
  input_textbox,
127
  slider
128
  ],
129
+ outputs="audio",
130
  title="xVASynth (WIP)",
131
  )
132