Rhueue commited on
Commit
c0d6538
·
1 Parent(s): 4b24336

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -4,6 +4,7 @@ import soundfile as sf
4
  import io
5
  import numpy as np
6
  from pydub import AudioSegment
 
7
 
8
  # Define a Streamlit app
9
  st.title("Audio Processing App")
@@ -29,16 +30,16 @@ if uploaded_audio is not None:
29
  channels=1 # Assuming mono audio
30
  )
31
 
32
- # Apply speed factor
33
- st.write("Applying speed factor...")
34
- slowed_audio = reduced_audio.speedup(playback_speed=0.5) # Adjust the speed factor as needed
35
 
36
  # Export the modified audio to a file
37
- slowed_audio.export("output_audio.wav", format="wav")
38
 
39
  # Provide a link to download the processed audio
40
  st.audio("output_audio.wav")
41
 
42
  # Run the Streamlit app
43
  if __name__ == "__main__":
44
- st.write("Upload an audio file to apply noise reduction and speed factor.")
 
4
  import io
5
  import numpy as np
6
  from pydub import AudioSegment
7
+ from pydub import effects
8
 
9
  # Define a Streamlit app
10
  st.title("Audio Processing App")
 
30
  channels=1 # Assuming mono audio
31
  )
32
 
33
+ # Set the speed factor
34
+ st.write("Setting speed factor...")
35
+ speeded_audio = reduced_audio.speedup(0.76) # Adjust the speed factor as needed
36
 
37
  # Export the modified audio to a file
38
+ speeded_audio.export("output_audio.wav", format="wav")
39
 
40
  # Provide a link to download the processed audio
41
  st.audio("output_audio.wav")
42
 
43
  # Run the Streamlit app
44
  if __name__ == "__main__":
45
+ st.write("Upload an audio file to apply noise reduction and set the speed factor.")