Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI and installable package included #853

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions GUI.py
Original file line number Diff line number Diff line change
@@ -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()
65 changes: 65 additions & 0 deletions commands notes
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 10 additions & 0 deletions install_dependencies.bat
Original file line number Diff line number Diff line change
@@ -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