Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -263,6 +263,17 @@ def adjust_pitch(audio_path, pitch_factor):
|
|
263 |
# Save adjusted audio
|
264 |
sf.write(audio_path, y_shifted, sr)
|
265 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
"""Set up the Gradio interface"""
|
267 |
|
268 |
import gradio as gr
|
|
|
263 |
# Save adjusted audio
|
264 |
sf.write(audio_path, y_shifted, sr)
|
265 |
|
266 |
+
def adjust_speed(audio_path, speed_factor):
|
267 |
+
# Load the audio file
|
268 |
+
y, sr = librosa.load(audio_path)
|
269 |
+
|
270 |
+
# Adjust the speed (this alters the duration of the audio)
|
271 |
+
y_speeded = librosa.effects.time_stretch(y, speed_factor)
|
272 |
+
|
273 |
+
# Save the adjusted audio
|
274 |
+
sf.write(audio_path, y_speeded, sr)
|
275 |
+
|
276 |
+
|
277 |
"""Set up the Gradio interface"""
|
278 |
|
279 |
import gradio as gr
|