StevenLe456 commited on
Commit
fd1cc3f
·
1 Parent(s): 9e6aa58

Changed audio handling

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,13 +8,13 @@ tone = load_minirocket("minirocket-tone-8981")
8
  vowel = load_minirocket("minirocket-vowel-9814")
9
 
10
  def classify(audio):
11
- sr, data = read(audio)
12
  arr = data.astype(float)
13
  m = mfcc(y=arr, sr=sr)
14
  t = tone.predict(m).item(0)
15
  v = tone.predict(m).item(0)
16
  return t, v
17
 
18
- app = gr.Interface(fn=classify, inputs=gr.Audio(source="microphone", type="filepath"), outputs=["text", "text"])
19
 
20
  app.launch()
 
8
  vowel = load_minirocket("minirocket-vowel-9814")
9
 
10
  def classify(audio):
11
+ sr, data = audio
12
  arr = data.astype(float)
13
  m = mfcc(y=arr, sr=sr)
14
  t = tone.predict(m).item(0)
15
  v = tone.predict(m).item(0)
16
  return t, v
17
 
18
+ app = gr.Interface(fn=classify, inputs=gr.Audio(source="microphone"), outputs=["text", "text"])
19
 
20
  app.launch()