Spaces:
Runtime error
Runtime error
Dr. Richard Zinck
commited on
Commit
·
5b273b0
1
Parent(s):
70c40af
Erros msg
Browse files- bat_ident.py +8 -8
bat_ident.py
CHANGED
@@ -198,14 +198,14 @@ def get_raw_audio_from_file(fpath: str):
|
|
198 |
try:
|
199 |
sig, rate = audio.openAudioFile(fpath, cfg.SAMPLE_RATE)
|
200 |
except Exception as ex:
|
201 |
-
print(f"Error: Cannot open audio file at load {
|
202 |
utils.writeErrorLog(ex)
|
203 |
chunks = None
|
204 |
# Split into raw audio chunks
|
205 |
try:
|
206 |
chunks = audio.splitSignal(sig, cfg.SAMPLE_RATE, cfg.SIG_LENGTH, cfg.SIG_OVERLAP, cfg.SIG_MINLEN)
|
207 |
except Exception as ex:
|
208 |
-
print(f"Error: Cannot chunk audio file {
|
209 |
utils.writeErrorLog(ex)
|
210 |
return chunks
|
211 |
|
@@ -251,16 +251,16 @@ def analyze_file(item):
|
|
251 |
# Status
|
252 |
print(f"Analyzing {fpath}", flush=True)
|
253 |
|
254 |
-
|
255 |
# Open audio file and split into 3-second chunks
|
256 |
-
|
257 |
|
258 |
# If no chunks, show error and skip
|
259 |
-
except Exception as ex:
|
260 |
-
|
261 |
-
|
262 |
|
263 |
-
|
264 |
|
265 |
# Process each chunk
|
266 |
try:
|
|
|
198 |
try:
|
199 |
sig, rate = audio.openAudioFile(fpath, cfg.SAMPLE_RATE)
|
200 |
except Exception as ex:
|
201 |
+
print(f"Error: Cannot open audio file at load {fpath}", flush=True)
|
202 |
utils.writeErrorLog(ex)
|
203 |
chunks = None
|
204 |
# Split into raw audio chunks
|
205 |
try:
|
206 |
chunks = audio.splitSignal(sig, cfg.SAMPLE_RATE, cfg.SIG_LENGTH, cfg.SIG_OVERLAP, cfg.SIG_MINLEN)
|
207 |
except Exception as ex:
|
208 |
+
print(f"Error: Cannot chunk audio file {fpath}", flush=True)
|
209 |
utils.writeErrorLog(ex)
|
210 |
return chunks
|
211 |
|
|
|
251 |
# Status
|
252 |
print(f"Analyzing {fpath}", flush=True)
|
253 |
|
254 |
+
# try:
|
255 |
# Open audio file and split into 3-second chunks
|
256 |
+
chunks = get_raw_audio_from_file(fpath)
|
257 |
|
258 |
# If no chunks, show error and skip
|
259 |
+
#except Exception as ex:
|
260 |
+
# print(f"Error: Cannot open audio file {fpath}", flush=True)
|
261 |
+
# utils.writeErrorLog(ex)
|
262 |
|
263 |
+
# return False
|
264 |
|
265 |
# Process each chunk
|
266 |
try:
|