File size: 638 Bytes
930aa22
788e6fb
61857f5
788e6fb
 
6625621
788e6fb
 
 
 
6625621
 
788e6fb
6625621
 
 
 
 
 
512b9f3
788e6fb
512b9f3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from speechbrain.pretrained import MetricGAN

# Load the MetricGAN model from Hugging Face
model = MetricGAN.from_hparams(source="speechbrain/metricgan-plus-voicebank")

# Define a function to enhance speech
def enhance_speech(audio_path):
    # Process the uploaded audio file through the model
    enhanced_audio = model.enhance(audio_path)
    return enhanced_audio

# Set up the Gradio interface
iface = gr.Interface(
    fn=enhance_speech,
    inputs=gr.Audio(source="upload", type="filepath"),
    outputs=gr.Audio(type="filepath"),
    title="Speech Enhancement"
)

# Launch the Gradio interface
iface.launch()