Spaces:
anvarazizov
/
Runtime error

vineelpratap commited on
Commit
303dfca
1 Parent(s): 408e3fc

Update lid.py

Browse files
Files changed (1) hide show
  1. lid.py +3 -0
lid.py CHANGED
@@ -30,6 +30,9 @@ def identify(audio_source=None, microphone=None, file_upload=None):
30
  audio_fp = (
31
  file_upload if "upload" in str(audio_source or "").lower() else microphone
32
  )
 
 
 
33
  audio_samples = librosa.load(audio_fp, sr=LID_SAMPLING_RATE, mono=True)[0]
34
 
35
  inputs = processor(
 
30
  audio_fp = (
31
  file_upload if "upload" in str(audio_source or "").lower() else microphone
32
  )
33
+ if audio_fp is None:
34
+ return "ERROR: You have to either use the microphone or upload an audio file"
35
+
36
  audio_samples = librosa.load(audio_fp, sr=LID_SAMPLING_RATE, mono=True)[0]
37
 
38
  inputs = processor(