File size: 1,491 Bytes
3a80d12
 
 
 
 
67cd354
3a80d12
 
 
da8b859
 
 
78cf1d9
0c27348
da8b859
 
 
 
 
4d34a6a
da8b859
 
 
78cf1d9
 
 
 
da8b859
 
ee7a8d0
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
28
29
30
31
import gradio as gr

def process_audio(file, model, prompt, start, length):
    # Dummy processing function to demonstrate functionality
    # Replace this with actual audio processing code
    processed_audio_path = "goodres.wav"
    # Add your audio processing code here
    return processed_audio_path

demo = gr.Interface(
    fn=process_audio,
    inputs=[
        # gr.Audio(type="filepath", label="Upload Audio File"),
        gr.Textbox(label="Prompt", placeholder="Enter your text prompt here"),
        gr.Radio(choices=['AudioLDM2', 'StableAudio'], label='Choose a Model for Processing'),
        gr.Textbox(label="Prompt", placeholder="Enter your text prompt here"),
        gr.Slider(0.0, 60.0, value=0.0, step=1.0, label="Starting Point (seconds)"),
        gr.Slider(1.0, 60.0, value=10.0, step=1.0, label="Output Length (seconds)", info="Longer audio takes more time to generate")
    ],
    outputs=gr.Audio(type="filepath", label="Processed Audio"),
    title="Drums Generation in Different Models",
    description="Upload your audio file and process it with AudioLDM2 or StableAudio based on your prompt and settings.",
    examples=[
        ["goodres.wav", "AudioLDM2", "Generate a rock beat", 0.0, 10.0],
        ["goodres.wav", "StableAudio", "Create a serene soundscape", 5.0, 15.0],
        ["goodres.wav", "AudioLDM2", "Simulate a forest ambiance", 10.0, 20.0],
        ["goodres.wav", "StableAudio", "Recreate a gentle rainfall", 0.0, 25.0]
    ]
)
demo.launch()