MIT / components /speech_restoration.py
Ashar086's picture
Create components/speech_restoration.py
847c5d7 verified
raw
history blame contribute delete
876 Bytes
import streamlit as st
from utils.ai_functions import restore_speech
from utils.data_processing import process_audio_samples
def show_speech_restoration():
st.title("Speech Restoration")
st.write("Restore speech for those with impairments using neural networks and audio samples.")
samples = st.file_uploader("Upload audio samples (WAV files)", accept_multiple_files=True, type=['wav'])
if st.button("Restore Speech"):
if samples:
with st.spinner("Processing audio samples..."):
processed_samples = process_audio_samples(samples)
with st.spinner("Restoring speech..."):
result = restore_speech(processed_samples)
st.success("Speech restoration complete!")
st.audio(result, format='audio/wav')
else:
st.warning("Please upload audio samples.")