File size: 737 Bytes
8aee03f
 
 
c108159
8aee03f
 
 
 
 
 
 
 
 
 
 
 
c108159
8aee03f
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import gradio_temp_fork as gr  # <-- important change
from pydub import AudioSegment
import tempfile

def clean_and_master(audio_file):
    # Load the audio
    audio = AudioSegment.from_file(audio_file)
    
    # [Placeholder for AI-based cleaning/mastering]
    # Example: basic normalization
    cleaned = audio.normalize()
    
    # Save to temp file
    with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as f:
        cleaned.export(f.name, format="wav")
        return f.name

iface = gr.Interface(
    fn=clean_and_master,
    inputs=gr.Audio(type="filepath"),
    outputs=gr.Audio(type="filepath"),
    title="Fix My Recording",
    description="Upload your audio to clean and master it with AI!"
)

iface.launch()