Commit
·
303dfca
1
Parent(s):
408e3fc
Update lid.py
Browse files
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(
|