From e3de5ac312966a9e4bb181a4305ca13bbc5ce0e3 Mon Sep 17 00:00:00 2001 From: FarazJamal <63965947+FarazJamal@users.noreply.github.com> Date: Thu, 8 Jun 2023 13:25:48 +0500 Subject: [PATCH 1/2] Notes only --- commands notes | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 commands notes diff --git a/commands notes b/commands notes new file mode 100644 index 000000000..31ece8214 --- /dev/null +++ b/commands notes @@ -0,0 +1,65 @@ +https://drive.google.com/file/d/1PA7JhqpiCvGA-0ooZgYFC06XjX-Q2B7T/view?usp=sharing +(main executable file link) + + + +This are the command line options: + +spleeter separate +Usage: spleeter separate [OPTIONS] FILES... + +Separate audio file(s) + +Arguments: +FILES... List of input audio file path [required] + +Options: +-i, --inputs TEXT (DEPRECATED) placeholder for deprecated +input option + +-a, --adapter TEXT Name of the audio adapter to use for audio +I/O [default: spleeter.audio.ffmpeg.FFMPEGP +rocessAudioAdapter] + +-b, --bitrate TEXT Audio bitrate to be used for the separated +output [default: 128k] + +-c, --codec [wav|mp3|ogg|m4a|wma|flac] +Audio codec to be used for the separated +output [default: wav] + +-d, --duration FLOAT Set a maximum duration for processing audio +(only separate offset + duration first +seconds of the input file) [default: 600.0] + +-s, --offset FLOAT Set the starting offset to separate audio +from [default: 0.0] + +-o, --output_path PATH Path of the output directory to write audio +files in [default: C:\Users\D\AppData\Local +\Temp\separated_audio] + +-B, --stft-backend [auto|tensorflow|librosa] +Who should be in charge of computing the +stfts. Librosa is faster than tensorflow on +CPU and uses less memory. "auto" will use +tensorflow when GPU acceleration is +available and librosa when not [default: +auto] + + +-f, --filename_format TEXT Template string that will be formatted to +generatedoutput filename. Such template +should be Python formattablestring, and +could use {filename}, {instrument}, and +{codec}variables [default: +{filename}/{instrument}.{codec}] + +-p, --params_filename TEXT JSON filename that contains params +[default: spleeter:2stems] + +--mwf Whether to use multichannel Wiener filtering +for separation [default: False] + +--verbose Enable verbose logs [default: False] +--help Show this message and exit. From 62c990f33ac09c12e2abea440b7a8ab832743258 Mon Sep 17 00:00:00 2001 From: FarazJamal <63965947+FarazJamal@users.noreply.github.com> Date: Fri, 16 Jun 2023 01:08:59 +0500 Subject: [PATCH 2/2] GUI and installable pkg GUI.py shows up GUI that displays spleeter options. install_dependencies.bat will install all the necessary packages for spleeter --- GUI.py | 115 +++++++++++++++++++++++++++++++++++++++ install_dependencies.bat | 10 ++++ 2 files changed, 125 insertions(+) create mode 100644 GUI.py create mode 100644 install_dependencies.bat diff --git a/GUI.py b/GUI.py new file mode 100644 index 000000000..da480cf9f --- /dev/null +++ b/GUI.py @@ -0,0 +1,115 @@ +import tkinter as tk +from tkinter import ttk +import subprocess + +# Command for spleeter separate +command = "spleeter separate" + +# Create a Tkinter window +window = tk.Tk() +window.title("Spleeter GUI") + +# Function to execute the command +def execute_command(): + # Get the values from the GUI elements + input_files = entry_files.get().split() + codec = combo_codec.get() + mwf = var_mwf.get() + duration = entry_duration.get() + offset = entry_offset.get() + output_path = entry_output_path.get() + stft_backend = var_stft_backend.get() + filename_format = entry_filename_format.get() + params_filename = entry_params_filename.get() + verbose = var_verbose.get() + + # Construct the command with the selected options + full_command = f"{command} {' '.join(input_files)} --codec {codec}" + if mwf: + full_command += " --mwf" + if duration: + full_command += f" --duration {duration}" + if offset: + full_command += f" --offset {offset}" + if output_path: + full_command += f" --output_path {output_path}" + if stft_backend: + full_command += f" --stft-backend {stft_backend}" + if filename_format: + full_command += f" --filename_format {filename_format}" + if params_filename: + full_command += f" --params_filename {params_filename}" + if verbose: + full_command += " --verbose" + + # Execute the command using subprocess + subprocess.run(full_command, shell=True) + +# Input files +label_files = tk.Label(window, text="Input Files:") +label_files.pack() +entry_files = tk.Entry(window, width=50) +entry_files.pack() + +# Codec selection +label_codec = tk.Label(window, text="Audio Codec:") +label_codec.pack() +var_codec = tk.StringVar() +combo_codec = ttk.Combobox(window, textvariable=var_codec) +combo_codec['values'] = ('wav', 'mp3', 'ogg', 'm4a', 'wma', 'flac') +combo_codec.pack() + +# MWF checkbox +var_mwf = tk.BooleanVar() +check_mwf = tk.Checkbutton(window, text="Use Multichannel Wiener Filtering", variable=var_mwf, onvalue=True, offvalue=False) +check_mwf.pack() + +# Duration entry +label_duration = tk.Label(window, text="Duration:") +label_duration.pack() +entry_duration = tk.Entry(window) +entry_duration.pack() + +# Offset entry +label_offset = tk.Label(window, text="Offset:") +label_offset.pack() +entry_offset = tk.Entry(window) +entry_offset.pack() + +# Output path entry +label_output_path = tk.Label(window, text="Output Path:") +label_output_path.pack() +entry_output_path = tk.Entry(window) +entry_output_path.pack() + +# STFT backend selection +label_stft_backend = tk.Label(window, text="STFT Backend:") +label_stft_backend.pack() +var_stft_backend = tk.StringVar() +combo_stft_backend = ttk.Combobox(window, textvariable=var_stft_backend) +combo_stft_backend['values'] = ('auto', 'tensorflow', 'librosa') +combo_stft_backend.pack() + +# Filename format entry +label_filename_format = tk.Label(window, text="Filename Format:") +label_filename_format.pack() +entry_filename_format = tk.Entry(window) +entry_filename_format.pack() + +# Params filename entry +label_params_filename = tk.Label(window, text="Params Filename:") +label_params_filename.pack() +entry_params_filename = tk.Entry(window) +entry_params_filename.pack() + +# Verbose checkbox +var_verbose = tk.BooleanVar() +check_verbose = tk.Checkbutton(window, text="Verbose", variable=var_verbose, onvalue=True, offvalue=False) +check_verbose.pack() + +# Button to execute the command +button_execute = tk.Button(window, text="Execute", command=execute_command) +button_execute.pack() + +# Start the Tkinter event loop +window.mainloop() diff --git a/install_dependencies.bat b/install_dependencies.bat new file mode 100644 index 000000000..6a20872f8 --- /dev/null +++ b/install_dependencies.bat @@ -0,0 +1,10 @@ +@echo off + +choco install python -y +choco install ffmpeg -y +choco install libsndfile -y +python -m pip install numpy pandas tensorflow spleeter poetry + + +echo Installation completed. +pause