Update app.py
Browse files
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 |
-
#
|
33 |
-
st.write("
|
34 |
-
|
35 |
|
36 |
# Export the modified audio to a file
|
37 |
-
|
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.")
|