Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import librosa
|
| 3 |
+
from transformers import pipeline
|
| 4 |
+
|
| 5 |
+
def analyze_comedy(audio):
|
| 6 |
+
# Here you'll process the audio. For now, let's just return some basic info
|
| 7 |
+
y, sr = librosa.load(audio, sr=None)
|
| 8 |
+
duration = librosa.get_duration(y=y, sr=sr)
|
| 9 |
+
return f"Audio Duration: {duration:.2f} seconds"
|
| 10 |
+
|
| 11 |
+
iface = gr.Interface(
|
| 12 |
+
fn=analyze_comedy,
|
| 13 |
+
inputs=gr.Audio(source="upload", type="filepath"),
|
| 14 |
+
outputs="text",
|
| 15 |
+
title="Stand-Up Comedy Tone Analyzer",
|
| 16 |
+
description="Upload a comedy audio clip to analyze its tone and comedic elements."
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
iface.launch()
|