jmparejaz commited on
Commit
7eb62ed
1 Parent(s): b64e350

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -81,8 +81,7 @@ def extract_features(data):
81
  return result
82
 
83
  def audio_emotions(audio):
84
- data = audio.flatten()
85
- sr=22050
86
  features_audio = extract_features(data)
87
  features_audio = np.array(features_audio)
88
  scaled_features=scaler.transform(features_audio)
@@ -97,15 +96,15 @@ def main(audio):
97
  return r1,r2,r3
98
 
99
 
100
- audio = gr.Audio(
101
- label="Input Audio",
102
- show_label=False,
103
- source="microphone",
104
- type="filepath"
105
- )
106
 
107
 
108
- app=gr.Interface(title="Sentiment Audio Analysis",fn=main,inputs=[audio], outputs=["text","text","text"])
109
 
110
 
111
 
 
81
  return result
82
 
83
  def audio_emotions(audio):
84
+ sr,data = audio
 
85
  features_audio = extract_features(data)
86
  features_audio = np.array(features_audio)
87
  scaled_features=scaler.transform(features_audio)
 
96
  return r1,r2,r3
97
 
98
 
99
+ #audio = gr.Audio(
100
+ # label="Input Audio",
101
+ # show_label=False,
102
+ # source="microphone",
103
+ # type="filepath"
104
+ # )
105
 
106
 
107
+ app=gr.Interface(title="Sentiment Audio Analysis",fn=main,inputs=gr.Audio(source="microphone"), outputs=["text","text","text"])
108
 
109
 
110