Spaces:
Runtime error
Runtime error
| 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() | |