Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,7 +82,7 @@ def analyze(path):
|
|
| 82 |
json_structure_output = os.path.join(root, file_path)
|
| 83 |
print(json_structure_output)
|
| 84 |
|
| 85 |
-
|
| 86 |
|
| 87 |
fig = allin1.visualize(
|
| 88 |
result,
|
|
@@ -200,7 +200,7 @@ def add_voice_labelv2(json_file, audio_path):
|
|
| 200 |
if begin_seq:
|
| 201 |
start_idx = voice_idxs[i]
|
| 202 |
begin_seq = False
|
| 203 |
-
if voice_idxs[i+1] == voice_idxs[i]
|
| 204 |
continue
|
| 205 |
|
| 206 |
start_time = float((start_idx*window_size_samples)/SAMPLING_RATE)
|
|
@@ -215,6 +215,8 @@ def add_voice_labelv2(json_file, audio_path):
|
|
| 215 |
"start_time": f"{start_minutes}.{start_seconds}",
|
| 216 |
"end_time": f"{end_minutes}.{end_seconds}"
|
| 217 |
}
|
|
|
|
|
|
|
| 218 |
|
| 219 |
except Exception as e:
|
| 220 |
print(f"An exception occurred: {e}")
|
|
|
|
| 82 |
json_structure_output = os.path.join(root, file_path)
|
| 83 |
print(json_structure_output)
|
| 84 |
|
| 85 |
+
add_voice_labelv2(json_structure_output, string_path)
|
| 86 |
|
| 87 |
fig = allin1.visualize(
|
| 88 |
result,
|
|
|
|
| 200 |
if begin_seq:
|
| 201 |
start_idx = voice_idxs[i]
|
| 202 |
begin_seq = False
|
| 203 |
+
if voice_idxs[i+1] == voice_idxs[i]+1:
|
| 204 |
continue
|
| 205 |
|
| 206 |
start_time = float((start_idx*window_size_samples)/SAMPLING_RATE)
|
|
|
|
| 215 |
"start_time": f"{start_minutes}.{start_seconds}",
|
| 216 |
"end_time": f"{end_minutes}.{end_seconds}"
|
| 217 |
}
|
| 218 |
+
|
| 219 |
+
begin_seq = True
|
| 220 |
|
| 221 |
except Exception as e:
|
| 222 |
print(f"An exception occurred: {e}")
|