Spaces:
Runtime error
Runtime error
File size: 762 Bytes
5fcfe61 01ac216 5fcfe61 c17e769 19fe9e7 c17e769 19fe9e7 c17e769 19fe9e7 c17e769 19fe9e7 c17e769 19fe9e7 c17e769 19fe9e7 c17e769 |
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 |
import subprocess
subprocess.run(["pip", "install", "-r", "requirements.txt"])
import gradio as gr
from pydub import AudioSegment
def synchronize_audio(vocal_file, beat_file):
# Load the audio files
vocal = AudioSegment.from_file(vocal_file)
beat = AudioSegment.from_file(beat_file)
# Synchronize the audio tracks
synchronized_audio = vocal.overlay(beat)
# Export the synchronized audio
synchronized_audio.export("output_synchronized_audio.mp3", format="mp3")
return "Audio synchronization completed. You can download the synchronized audio."
# Gradio interface
iface = gr.Interface(
synchronize_audio,
inputs=[gr.File("Vocal File"), gr.File("Beat File")],
outputs=gr.Textbox(),
live=True
)
iface.launch()
|