Spaces:
Runtime error
Runtime error
Max Brodeur-Urbas
commited on
Commit
·
d4bedbd
1
Parent(s):
6912fb9
added audio check in predict function
Browse files
app.py
CHANGED
@@ -35,6 +35,10 @@ run_cmd('pip -q install pydub')
|
|
35 |
from pydub import AudioSegment
|
36 |
|
37 |
def predict(audio_file_path):
|
|
|
|
|
|
|
|
|
38 |
input_data = open(audio_file_path, 'rb').read()
|
39 |
print(len(input_data))
|
40 |
|
|
|
35 |
from pydub import AudioSegment
|
36 |
|
37 |
def predict(audio_file_path):
|
38 |
+
if(audio_file_path == None):
|
39 |
+
output = "Please record your voice using the record button before submitting :)"
|
40 |
+
return output, {}, ""
|
41 |
+
|
42 |
input_data = open(audio_file_path, 'rb').read()
|
43 |
print(len(input_data))
|
44 |
|