separator

package
v0.8.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package separator finds a stem separator the owner already installed (Demucs, Spleeter, audio-separator), so karaoke needs no configuration: the server looks on the PATH and in the usual places such tools are installed, and uses the best it finds. It never installs anything, and what it finds is a program on this machine, never a name from a request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UsualDirs

func UsualDirs() []string

UsualDirs are where pip, pipx, Homebrew and Conda put programs, beyond the PATH. A server started as a service often has a short PATH that leaves these out.

Types

type Found

type Found struct {
	// Name is what it is called for people: "Demucs", "Spleeter", "audio-separator".
	Name string `json:"name"`
	// Version is what the program says its version is, "" when it doesn't say.
	Version string `json:"version,omitempty"`
	// Path is the program that runs.
	Path string `json:"-"`
	// Words are the command, with {input} and {output}, as mediaextras.SeparatorCommand takes it.
	Words []string `json:"-"`
}

Found is a separator on this machine.

func Discover

func Discover(ctx context.Context, o Options) *Found

Discover looks for a separator, best first: a demucs program, then Python's demucs module, then spleeter, then audio-separator. It answers nil when there is none.

type Options

type Options struct {
	// Dirs are searched in order. Nil means the PATH and then UsualDirs.
	Dirs []string
	// Python names the interpreters tried for "python -m demucs". Nil means python3, python.
	Python []string
	// Timeout for each question asked of a program (its version, whether a module imports).
	Timeout time.Duration
}

Options say where to look. The zero value looks where a real machine has them.

func (Options) SearchDirs

func (o Options) SearchDirs() []string

SearchDirs are the folders Discover looks in, in order, for the log when it finds nothing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL