Anita-19 commited on
Commit
331d92d
Β·
verified Β·
1 Parent(s): 9d6989d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
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