tee342 commited on
Commit
e0bb421
·
verified ·
1 Parent(s): 711fbb5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -25
app.py CHANGED
@@ -306,22 +306,6 @@ def analyze_audio(audio_path):
306
 
307
  return stats, image
308
 
309
- # === Speaker Matching (Voiceprint) ===
310
- from resemblyzer import preprocess_wav, VoiceEncoder
311
-
312
- encoder = VoiceEncoder()
313
-
314
- def match_speakers(clip1, clip2):
315
- try:
316
- wav1 = preprocess_wav(clip1)
317
- wav2 = preprocess_wav(clip2)
318
- embed1 = encoder.embed_utterance(wav1)
319
- embed2 = encoder.embed_utterance(wav2)
320
- similarity = np.inner(embed1, embed2)
321
- return f"Speaker Match Score: {similarity:.2f}"
322
- except Exception as e:
323
- return f"⚠️ Error: {str(e)}"
324
-
325
  # === Mix Two Tracks ===
326
  def mix_tracks(track1, track2, volume_offset=0):
327
  a1 = AudioSegment.from_file(track1)
@@ -443,17 +427,17 @@ with gr.Blocks(title="AI Audio Studio", css="style.css") as demo:
443
  description="Type anything and turn it into natural-sounding speech."
444
  )
445
 
446
- # --- Speaker Matching ---
447
- with gr.Tab("🧏‍♂️ Match Speakers"):
448
  gr.Interface(
449
- fn=match_speakers,
450
- inputs=[
451
- gr.File(label="Clip 1"),
452
- gr.File(label="Clip 2")
 
453
  ],
454
- outputs=gr.Textbox(label="Match Score", lines=1),
455
- title="Are These the Same Person?",
456
- description="Detect speaker similarity using AI."
457
  )
458
 
459
  # --- Mix Two Tracks ---
 
306
 
307
  return stats, image
308
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  # === Mix Two Tracks ===
310
  def mix_tracks(track1, track2, volume_offset=0):
311
  a1 = AudioSegment.from_file(track1)
 
427
  description="Type anything and turn it into natural-sounding speech."
428
  )
429
 
430
+ # --- Audio Analysis Dashboard ---
431
+ with gr.Tab("📊 Audio Analysis"):
432
  gr.Interface(
433
+ fn=analyze_audio,
434
+ inputs=gr.Audio(label="Upload Track", type="filepath"),
435
+ outputs=[
436
+ gr.JSON(label="Audio Stats"),
437
+ gr.Image(label="Waveform Graph")
438
  ],
439
+ title="View Loudness, BPM, Silence, and More",
440
+ description="Analyze audio loudness, tempo, and frequency content."
 
441
  )
442
 
443
  # --- Mix Two Tracks ---