Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
"""Set up the Gradio interface"""
|
2 |
|
3 |
import gradio as gr
|
|
|
1 |
+
def adjust_pitch(audio_path, pitch_factor):
|
2 |
+
# Load audio
|
3 |
+
y, sr = librosa.load(audio_path)
|
4 |
+
# Adjust pitch
|
5 |
+
y_shifted = librosa.effects.pitch_shift(y, sr, n_steps=pitch_factor)
|
6 |
+
# Save adjusted audio
|
7 |
+
sf.write(audio_path, y_shifted, sr)
|
8 |
+
|
9 |
+
|
10 |
"""Set up the Gradio interface"""
|
11 |
|
12 |
import gradio as gr
|