Skip to content

chadnpc/MvsepClient

Repository files navigation

Blazingly fast MVSep API client PowerShell module

Downloads

Installation

Install-Module mvsepclient -Scope CurrentUser

Requirements

Quick Start

Import-Module mvsepclient

# Get your API token from https://mvsep.com/user-api
$client = [MvsepClient]::new("YOUR_API_KEY")

# Get available algorithms
$algos = $client.GetAlgorithms()

CLI Usage

The module provides a CLI interface via Invoke-MvSepClient (alias: MvSepClient):

Import-Module mvsepclient

Get Available Separation Types

Invoke-MvSepClient get-types --token YOUR_API_KEY

# Or use the alias :)
MvSepClient algorithms --token YOUR_API_KEY

Separate a Single File

MvSepClient separate --input song.mp3 --output ./output --token YOUR_API_KEY --sep_type 48

Separate a File with Automatic Wait

Wait for processing to complete and download automatically:

MvSepClient separate --input song.mp3 --output ./output --token YOUR_API_KEY --sep_type 48 --wait

Separate a Directory

MvSepClient separate --input ./audio --output ./output --token YOUR_API_KEY --sep_type 48

Download Result by Hash

MvSepClient get-result --hash YOUR_HASH --output ./output --token YOUR_API_KEY

Get Queue Information

MvSepClient queue --token YOUR_API_KEY

Get News

MvSepClient news --token YOUR_API_KEY --lang en --limit 10

Get Separation History

MvSepClient history --token YOUR_API_KEY --start 0 --limit 20

Premium Management

# Enable premium
MvSepClient premium-enable --token YOUR_API_KEY

# Disable premium
MvSepClient premium-disable --token YOUR_API_KEY

Long Filenames

# Enable long filenames
MvSepClient long-filenames-enable --token YOUR_API_KEY

# Disable long filenames
MvSepClient long-filenames-disable --token YOUR_API_KEY

Class Usage

Create Client

Import-Module mvsepclient

# Basic usage
$client = [MvsepClient]::new("YOUR_API_KEY")

# With custom retries
$client = [MvsepClient]::new("YOUR_API_KEY", 60, 30)

# Or use the static factory method
$client = [MvsepClient]::New("YOUR_API_KEY")

Get Algorithms

$algos = $client.GetAlgorithms()

# Or use static method (no instance needed)
$algos = [MvsepClient]::GetAlgorithmsStatic()

Create Separation

# For a local file
$params = @{
    audiofile = "song.mp3"
    sep_type = 48          # MelBand Roformer
    add_opt1 = 1
    output_format = 1     # WAV
}

$result = $client.CreateSeparation($params)

if ($result.success) {
    $hash = $result.data.hash
    Write-Host "Created task: $hash"
}

Wait for Result

$hash = "YOUR_TASK_HASH"

# Poll for status
for ($i = 0; $i -lt 30; $i++) {
    $status = $client.GetSeparationStatus($hash)

    if ($status.status -eq "done") {
        Write-Host "Processing complete!"
        break
    }

    if ($status.status -in @("failed", "error")) {
        Write-Host "Processing failed"
        break
    }

    Start-Sleep -Seconds 20
}

# Download files
foreach ($file in $status.data.files) {
    $url = $file.url.Replace('\/', '/')
    $client.DownloadTrack($url, "./output/$($file.download)")
}

Process Directory

$options = @{
    sep_type = 48         # MelBand Roformer
    add_opt1 = 1
    output_format = 1    # WAV
}

$client.ProcessDirectory("./input", "./output", $options)

Get Queue Info

# Instance method
$queue = $client.GetQueueInfo()

# Static method
$queue = [MvsepClient]::GetQueueInfoStatic()

Get News

# Instance method
$news = $client.GetNews("en", 0, 10)

# Static method
$news = [MvsepClient]::GetNewsStatic("en", 0, 10)

Get History

$history = $client.GetHistory(0, 20)

Premium Management

$client.EnablePremium()
$client.DisablePremium()

Long Filenames

$client.EnableLongFilenames()
$client.DisableLongFilenames()

Quality Checker

$result = $client.CreateQualityEntry(
    "path/to/results.zip",
    "MelBand Roformer",
    "Test results",
    0,  # dataset_type
    0,  # ensemble
    ""  # password (optional)
)

Available Separation Types

ID Name Description
48 MelBand Roformer Vocals, instrumental
40 BS Roformer Vocals, instrumental
20 Demucs4 HT Vocals, drums, bass, other
25 MDX23C Vocals, instrumental
46 SCNet Vocals, instrumental
9 Ultimate Vocal Remover VR Vocals, music
26 Ensemble Vocals, instrum
28 Ensemble All-In Multiple stems

For the complete list, run:

MvSepClient get-types --token YOUR_API_KEY

License

This project is licensed under the WTFPL License.

About

[Unofficial] [wip] Mvsep (Music & voice Separation) Client

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors