Spaces:
Running on Zero
Running on Zero
Jahmori commited on
Commit ·
a20fdd7
1
Parent(s): 29ce2e6
- tested set and configured to allow append
Browse files
app.py
CHANGED
|
@@ -147,6 +147,8 @@ def process_audio(mixture):
|
|
| 147 |
|
| 148 |
# Dictionary to store speaker information
|
| 149 |
log = {}
|
|
|
|
|
|
|
| 150 |
|
| 151 |
# Storing both speakers
|
| 152 |
file_paths = sorted(glob.glob(f"{sources}/speaker_*.wav")) # Glob finds all similar files
|
|
@@ -156,7 +158,7 @@ def process_audio(mixture):
|
|
| 156 |
spk_1 = file_paths[0]
|
| 157 |
spk_2 = file_paths[1]
|
| 158 |
|
| 159 |
-
|
| 160 |
for i, path in enumerate(file_paths):
|
| 161 |
speaker_key = f"speaker_{i}"
|
| 162 |
log[speaker_key] = {}
|
|
@@ -196,21 +198,20 @@ def process_audio(mixture):
|
|
| 196 |
|
| 197 |
|
| 198 |
log[speaker_key]["transcriptions"] = transcriptions
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
-
for segment in segments:
|
| 206 |
-
full_timestamp.append(segment)
|
| 207 |
|
|
|
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
-
return spk_1, spk_2, log,
|
| 214 |
|
| 215 |
demo = gr.Interface(
|
| 216 |
fn=process_audio,
|
|
|
|
| 147 |
|
| 148 |
# Dictionary to store speaker information
|
| 149 |
log = {}
|
| 150 |
+
full_timestamps = []
|
| 151 |
+
|
| 152 |
|
| 153 |
# Storing both speakers
|
| 154 |
file_paths = sorted(glob.glob(f"{sources}/speaker_*.wav")) # Glob finds all similar files
|
|
|
|
| 158 |
spk_1 = file_paths[0]
|
| 159 |
spk_2 = file_paths[1]
|
| 160 |
|
| 161 |
+
|
| 162 |
for i, path in enumerate(file_paths):
|
| 163 |
speaker_key = f"speaker_{i}"
|
| 164 |
log[speaker_key] = {}
|
|
|
|
| 198 |
|
| 199 |
|
| 200 |
log[speaker_key]["transcriptions"] = transcriptions
|
| 201 |
+
if transcriptions["chunks"]:
|
| 202 |
+
for chunk in transcription["chunks"]:
|
| 203 |
+
full_timestamps.append(chunk)
|
| 204 |
|
| 205 |
|
| 206 |
|
|
|
|
|
|
|
| 207 |
|
| 208 |
+
# segments = list(transcriptions["chunks"])
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
+
return spk_1, spk_2, log, full_timestamps
|
| 215 |
|
| 216 |
demo = gr.Interface(
|
| 217 |
fn=process_audio,
|