Pablo276 commited on
Commit
97c41eb
1 Parent(s): bc570b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -4,9 +4,9 @@ import soundfile as sf
4
  import gradio as gr
5
 
6
  def calculate_pesq(reference_audio, degraded_audio):
7
- # Directly use the audio data and sample rates passed from Gradio
8
- ref_signal, ref_sample_rate = reference_audio
9
- deg_signal, deg_sample_rate = degraded_audio
10
 
11
  # Convert audio data to the same sample rate if needed
12
  if ref_sample_rate != deg_sample_rate:
@@ -27,8 +27,8 @@ def calculate_snr(reference_audio, degraded_audio):
27
  return snr
28
 
29
  def calculate_audio_difference(reference_audio, degraded_audio):
30
- ref_signal, ref_sample_rate = reference_audio
31
- deg_signal, deg_sample_rate = degraded_audio
32
 
33
  if ref_sample_rate != deg_sample_rate:
34
  from scipy.signal import resample
 
4
  import gradio as gr
5
 
6
  def calculate_pesq(reference_audio, degraded_audio):
7
+ # Extract audio data and sample rates from Gradio's Audio widget output
8
+ ref_signal, ref_sample_rate = reference_audio[0], reference_audio[1]
9
+ deg_signal, deg_sample_rate = degraded_audio[0], degraded_audio[1]
10
 
11
  # Convert audio data to the same sample rate if needed
12
  if ref_sample_rate != deg_sample_rate:
 
27
  return snr
28
 
29
  def calculate_audio_difference(reference_audio, degraded_audio):
30
+ ref_signal, ref_sample_rate = reference_audio[0], reference_audio[1]
31
+ deg_signal, deg_sample_rate = degraded_audio[0], degraded_audio[1]
32
 
33
  if ref_sample_rate != deg_sample_rate:
34
  from scipy.signal import resample