Spaces:
Running
on
Zero
Running
on
Zero
fix: using the mp3 format
Browse files
app.py
CHANGED
@@ -55,11 +55,14 @@ def standardize_title(input_title):
|
|
55 |
Returns:
|
56 |
str: Standardized title in "Artist - Title" format
|
57 |
"""
|
|
|
|
|
|
|
58 |
# Remove content within parentheses or brackets
|
59 |
title_cleaned = re.sub(r"[\(\[].*?[\)\]]", "", input_title)
|
60 |
|
61 |
# Remove unnecessary words
|
62 |
-
unnecessary_words = ["official", "video", "hd", "4k", "lyrics", "music", "audio", "visualizer", "remix"]
|
63 |
title_cleaned = re.sub(r"\b(?:{})\b".format("|".join(unnecessary_words)), "", title_cleaned, flags=re.IGNORECASE)
|
64 |
|
65 |
# Split title into parts
|
@@ -346,7 +349,7 @@ def process_audio(uploaded_file):
|
|
346 |
move_stems_to_parent(OUTPUT_FOLDER)
|
347 |
|
348 |
yield "Combining stems...", None
|
349 |
-
output_file = combine_stems_for_all(OUTPUT_FOLDER, "
|
350 |
|
351 |
yield "Cleaning up...", None
|
352 |
delete_folders_and_files(OUTPUT_FOLDER)
|
@@ -361,7 +364,7 @@ def process_audio(uploaded_file):
|
|
361 |
with gr.Blocks() as demo:
|
362 |
gr.Markdown("# Music Player and Processor")
|
363 |
|
364 |
-
file_upload = gr.File(label="Upload
|
365 |
process_button = gr.Button("Process Audio")
|
366 |
log_output = gr.Textbox(label="Processing Log", interactive=False)
|
367 |
processed_audio_output = gr.File(label="Processed Audio")
|
|
|
55 |
Returns:
|
56 |
str: Standardized title in "Artist - Title" format
|
57 |
"""
|
58 |
+
|
59 |
+
title_cleaned = input_title.replace("utomp3.com", "").replace("_320kbps", "")
|
60 |
+
|
61 |
# Remove content within parentheses or brackets
|
62 |
title_cleaned = re.sub(r"[\(\[].*?[\)\]]", "", input_title)
|
63 |
|
64 |
# Remove unnecessary words
|
65 |
+
unnecessary_words = ["official", "video", "hd", "4k", "lyrics", "music", "audio", "visualizer", "remix", "", "utomp3.com - ", "_320kps"]
|
66 |
title_cleaned = re.sub(r"\b(?:{})\b".format("|".join(unnecessary_words)), "", title_cleaned, flags=re.IGNORECASE)
|
67 |
|
68 |
# Split title into parts
|
|
|
349 |
move_stems_to_parent(OUTPUT_FOLDER)
|
350 |
|
351 |
yield "Combining stems...", None
|
352 |
+
output_file = combine_stems_for_all(OUTPUT_FOLDER, "mp3")
|
353 |
|
354 |
yield "Cleaning up...", None
|
355 |
delete_folders_and_files(OUTPUT_FOLDER)
|
|
|
364 |
with gr.Blocks() as demo:
|
365 |
gr.Markdown("# Music Player and Processor")
|
366 |
|
367 |
+
file_upload = gr.File(label="Upload MP3 file", file_types=[".mp3"])
|
368 |
process_button = gr.Button("Process Audio")
|
369 |
log_output = gr.Textbox(label="Processing Log", interactive=False)
|
370 |
processed_audio_output = gr.File(label="Processed Audio")
|