Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
# ---
|
447 |
-
with gr.Tab("
|
448 |
gr.Interface(
|
449 |
-
fn=
|
450 |
-
inputs=
|
451 |
-
|
452 |
-
gr.
|
|
|
453 |
],
|
454 |
-
|
455 |
-
|
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 ---
|