VeuReu commited on
Commit
437b633
·
verified ·
1 Parent(s): 91b4928

Update preprocessing_router.py

Browse files
Files changed (1) hide show
  1. preprocessing_router.py +8 -14
preprocessing_router.py CHANGED
@@ -272,31 +272,26 @@ async def finalize_casting(
272
 
273
  print(voice_clusters)
274
 
275
- print("\n" + "="*50)
276
- print("DEBUG: PROCESANDO VOCES")
277
- print("="*50)
278
-
279
  for v_idx, cluster in enumerate(voice_clusters):
280
  v_name = cluster.get("name", f"Voz_{v_idx}")
281
- v_folder = cluster.get("folder", "")
282
- v_files = cluster.get("files", [])
283
 
284
  print(f"🔊 Voz {v_idx+1}: {v_name}")
285
- print(f" 📂 Carpeta origen: {v_folder}")
286
- print(f" 🎵 Audios seleccionados ({len(v_files)}):")
287
 
288
- for f in v_files:
289
- f_name = Path(f).name # seg_0001.wav
290
- f_path = Path(v_folder) / f_name
291
 
292
  if not f_path.exists():
293
  print(f"❌ NO EXISTE: {f_path}")
294
  continue
295
 
296
- # ⬇️ AQUÍ tu función de embeddings de audio
297
  v_emb = get_voice_embedding(str(f_path))
298
 
299
- print(f" - original: {f}")
300
  print(f" - resolved: {f_path}")
301
  print(f" - emb: {'OK' if v_emb else 'VACÍO'}")
302
 
@@ -308,7 +303,6 @@ async def finalize_casting(
308
 
309
  print("-" * 30)
310
 
311
-
312
  print(casting_json)
313
 
314
  MEDIA_ROOT = _P("/data/media")
 
272
 
273
  print(voice_clusters)
274
 
275
+ AUDIO_BASE_FOLDER = f"/tmp/temp/prueba_ana/voice_clusters/{label}" # Ajusta según tu estructura real
276
+
 
 
277
  for v_idx, cluster in enumerate(voice_clusters):
278
  v_name = cluster.get("name", f"Voz_{v_idx}")
279
+ clips = cluster.get("clips", [])
 
280
 
281
  print(f"🔊 Voz {v_idx+1}: {v_name}")
282
+ print(f" 🎵 Clips seleccionados ({len(clips)}):")
 
283
 
284
+ for clip_name in clips:
285
+ f_path = Path(AUDIO_BASE_FOLDER) / clip_name
 
286
 
287
  if not f_path.exists():
288
  print(f"❌ NO EXISTE: {f_path}")
289
  continue
290
 
291
+ # Llamada a tu función de embedding
292
  v_emb = get_voice_embedding(str(f_path))
293
 
294
+ print(f" - clip: {clip_name}")
295
  print(f" - resolved: {f_path}")
296
  print(f" - emb: {'OK' if v_emb else 'VACÍO'}")
297
 
 
303
 
304
  print("-" * 30)
305
 
 
306
  print(casting_json)
307
 
308
  MEDIA_ROOT = _P("/data/media")