|
import streamlit as st |
|
from pydub import AudioSegment |
|
import io |
|
|
|
|
|
st.title("Audio Speed Reduction App") |
|
|
|
|
|
uploaded_audio = st.file_uploader("Upload an audio file", type=["mp3", "wav", "ogg", "flac", "wma", "m4a"]) |
|
|
|
if uploaded_audio is not None: |
|
audio_bytes = uploaded_audio.read() |
|
|
|
|
|
audio = AudioSegment.from_file(io.BytesIO(audio_bytes)) |
|
|
|
|
|
st.write("Slowing down audio...") |
|
slowed_audio = audio.speedup(playback_speed=0.5) |
|
|
|
|
|
slowed_audio_bytes = slowed_audio.export(format="wav").read() |
|
|
|
|
|
st.audio(slowed_audio_bytes, format="audio/wav") |
|
|
|
|
|
if __name__ == "__main__": |
|
st.write("Upload an audio file to apply speed reduction.") |
|
|