Hendrik Schroeter commited on
Commit
0b334e9
1 Parent(s): b580a02

Add apt ffmpeg package

Browse files
Files changed (2) hide show
  1. app.py +3 -10
  2. packages.txt +1 -0
app.py CHANGED
@@ -67,14 +67,7 @@ def load_audio_gradio(
67
  if audio_or_file.lower()=="none":
68
  return None
69
  # First try default format
70
- try:
71
- audio, meta = load_audio(audio_or_file, sr)
72
- except RuntimeError:
73
- # Probably running in chrome which results in an webm/opus encoded '.wav' file - argggg
74
- import shutil, os
75
- audio_or_file = shutil.move(audio_or_file, os.path.splitext(audio_or_file)[0]+".opus")
76
- print(audio_or_file)
77
- audio, meta = load_audio(audio_or_file, sr)
78
  else:
79
  meta = AudioMetaData(-1, -1, -1, -1, "")
80
  assert isinstance(audio_or_file, (tuple, list))
@@ -240,9 +233,9 @@ def spec_figure(
240
  inputs = [
241
  gradio.inputs.Audio(
242
  source="microphone",
243
- type="filepath",
244
  optional=True,
245
- label="Record your own voice (Only works with Firefox)",
246
  ),
247
  gradio.inputs.Audio(
248
  source="upload",
 
67
  if audio_or_file.lower()=="none":
68
  return None
69
  # First try default format
70
+ audio, meta = load_audio(audio_or_file, sr)
 
 
 
 
 
 
 
71
  else:
72
  meta = AudioMetaData(-1, -1, -1, -1, "")
73
  assert isinstance(audio_or_file, (tuple, list))
 
233
  inputs = [
234
  gradio.inputs.Audio(
235
  source="microphone",
236
+ type="numpy",
237
  optional=True,
238
+ label="Record your own voice",
239
  ),
240
  gradio.inputs.Audio(
241
  source="upload",
packages.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ ffmpeg