akpande2 commited on
Commit
081fe78
·
verified ·
1 Parent(s): 5d65251

Update pipeline.py

Browse files
Files changed (1) hide show
  1. pipeline.py +5 -2
pipeline.py CHANGED
@@ -677,6 +677,8 @@ class UltraRobustCallAnalytics:
677
  """Analyze formant frequencies (F1, F2) for gender detection"""
678
  try:
679
  # Use Praat for formant analysis
 
 
680
  snd = parselmouth.Sound(audio, sampling_frequency=sr)
681
  formant = snd.to_formant_burg()
682
 
@@ -721,8 +723,9 @@ class UltraRobustCallAnalytics:
721
  gender = "FEMALE"
722
  confidence = 0.5
723
 
724
- return gender, confidence
725
-
 
726
  except Exception as e:
727
  return "UNKNOWN", 0.0
728
 
 
677
  """Analyze formant frequencies (F1, F2) for gender detection"""
678
  try:
679
  # Use Praat for formant analysis
680
+ import parselmouth
681
+ from parselmouth.praat import call
682
  snd = parselmouth.Sound(audio, sampling_frequency=sr)
683
  formant = snd.to_formant_burg()
684
 
 
723
  gender = "FEMALE"
724
  confidence = 0.5
725
 
726
+ return gender, confidence
727
+ except ImportError:
728
+ return "UNKNOWN", 0.0
729
  except Exception as e:
730
  return "UNKNOWN", 0.0
731