Skip to content

Commit

Permalink
Bumped version to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wudicgi committed Feb 2, 2024
1 parent 16288a6 commit 9624d7b
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 41 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SpleeterMsvcExe

## Changelog ([中文](#更新日志))

### v2.0 (2024-02-02)

- Added support to 22kHz models, and also updated the model files (the new program cannot use the old model files)
- Added environment checks, which will display an error message when the CPU lacks required features or when DLL loading fails
- Added --tracks parameter to allow user to select output tracks or do simple mixing
- Added --debug switch to output debug information
- Modified --output parameter to be a file path format string that supports using variables
- Replaced tensorflow library with a customized version 1.15.5-mod.1, which allows set the filename of saved_model.pb
- Upgraded ffmpeg-win64 library to v6.1.1
- Fixed the bug that sometimes the encoder will generate warnings "N frames left in the queue on closing"

### v1.0 (2021-05-12)

- Initial version

## 更新日志

### v2.0 (2024-02-02)

- 添加了对 22kHz 模型的支持,同时更新了模型文件 (新版本程序不可以使用旧版本的模型文件)
- 添加了对运行环境的检查,当 CPU 缺少必要特性或 DLL 加载失败时,将给出错误提示
- 添加了 --tracks 参数,允许用户选择要输出的音轨,或进行简单的混音
- 添加了 --debug 开关,用于输出调试信息
- 将 --output 参数修改为支持文件路径格式字符串,并支持使用变量
- 将 tensorflow 库替换为了定制的 1.15.5-mod.1 版本,该版本允许指定不同的 saved_model.pb 文件名
- 将 ffmpeg-win64 库升级到了 v6.1.1 版本
- 解决了有时会导致编码器输出警告信息 "N frames left in the queue on closing" 的 bug

### v1.0 (2021-05-12)

- 初始版本
105 changes: 70 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,73 @@

SpleeterMsvcExe is a Windows command line program for [Spleeter](https://github.com/deezer/spleeter), which can be used directly.

It is written in pure C language, using ffmpeg to read and write audio files, and using Tensorflow C API to make use of Spleeter models. No need to install Python environment, and it does not contain anything related to Python.
It is written in pure C language, using ffmpeg to read and write audio files, and using Tensorflow C API to make use of Spleeter models. There is no need to install a Python environment, and it does not contain anything related to Python.

Furthermore, SpleeterMsvcExe reduced the memory usage through segmented processing, hence it can handle single audio file over 30 minutes. Due to the length-extending process, all segments can be concatenated seamlessly.
Furthermore, SpleeterMsvcExe has reduced memory usage through segmented processing, allowing it to handle single audio file over 30 minutes. With the length-extending process, all segments can be seamlessly concatenated.

## 2. Usage

Download the latest release version program, and extract.

Run the `download_models.bat` batch script in models folder, to automatically download and extract Spleeter model files. Or manually download the `models-all.zip` file in releases, and extract it to models folder (if the 16kHz models are needed, you need to run `generate_16kHz.bat` too).

Drag-and-drop the song.mp3 file to `spleeter.exe`, or execute the following command:
Drag-and-drop the song.mp3 file to `Spleeter.exe`, or execute the following command:

```
spleeter.exe song.mp3
Spleeter.exe song.mp3
```

It will split song.mp3 into two tracks: song.vocals.mp3 and song.accompaniment.mp3

If it reports missing DLL files, please install [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 (x64)](https://aka.ms/vs/16/release/vc_redist.x64.exe) ([Source](https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0)).
If it reports missing DLL files, please install [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 (x64)](https://aka.ms/vs/16/release/vc_redist.x64.exe) ([Source Page](https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0)).

## 3. Help and more examples
## 3. Help and usage examples

```
Usage: spleeter [options] <input_file_path>
Usage: Spleeter.exe [options] <input_file_path>
Options:
-m, --model Spleeter model name
(2stems, 4stems, 5stems-16kHz, ..., default: 2stems)
-o, --output Output base file name
(in the format of filename.ext, default: <input_file_path>)
-b, --bitrate Output file bit rate
(128k, 192000, 256k, ..., default: 256k)
-m, --model Spleeter model name (i.e. the folder name in models folder)
2stems, 4stems, 5stems-22khz, ..., default is 2stems
-o, --output Output file path format
Default is empty, which is equivalent to $(DirPath)\$(BaseName).$(TrackName).$(Ext)
Supported variable names and example values:
$(FullPath) D:\Music\test.mp3
$(DirPath) D:\Music
$(FileName) test.mp3
$(BaseName) test
$(Ext) mp3
$(TrackName) vocals,drums,bass,...
-b, --bitrate Output file bitrate (unused for lossless or constant quantizer encoding)
128k, 192000, 256k, ..., default is 256k
-t, --tracks Output track list (comma separated track names)
Default value is empty to output all tracks
Available track names:
input, vocals, accompaniment, drums, bass, piano, other
Examples:
accompaniment Output accompaniment track only
vocals,drums Output vocals and drums tracks
mixed=vocals+drums Mix vocals and drums as "mixed" track
vocals,acc=input-vocals Output vocals and accompaniment for 4stems model
--overwrite Overwrite when the target output file exists
--verbose Display detailed processing information
--debug Display debug information
-h, --help Display this help and exit
-v, --version Display program version and exit
Examples:
spleeter -m 2stems song.mp3
Spleeter.exe -m 2stems song.mp3
- Splits song.mp3 into 2 tracks: vocals, accompaniment
- Outputs 2 files: song.vocals.mp3, song.accompaniment.mp3
- Output file format is same as input, using default bitrate 256kbps
spleeter -m 4stems -o result.m4a -b 192k song.mp3
Spleeter.exe -m 4stems -o result.m4a -b 192k song.mp3
- Splits song.mp3 into 4 tracks: vocals, drums, bass, other
- Outputs 4 files: result.vocals.m4a, result.drums.m4a, ...
- Output file format is M4A, using bitrate 192kbps
spleeter --model 5stems-16kHz --bitrate 320000 song.mp3
Spleeter.exe --model 5stems-22khz --bitrate 320000 song.mp3
- Long option example
- Use fine-tuned model, spliting song.mp3 into 5 tracks
- Using the model of which upper frequency limit is 22kHz
- Splits song.mp3 into 5 tracks
```

## 4. Acknowledgements
Expand All @@ -82,48 +99,66 @@ SpleeterMsvcExe 是 [Spleeter](https://github.com/deezer/spleeter) 的 Windows

下载最新的 release 版本程序,解压到任意位置。

执行 models 目录中的 `download_models.bat` 脚本自动下载并解压 Spleeter 模型文件。或手动下载 release 中的 `models-all.zip` 文件并解压到 models 目录中 (如果需要 16kHz 模型还需手动执行 `generate_16kHz.bat`)。

将 song.mp3 文件拖拽到 `spleeter.exe` 上,或在命令行执行
将 song.mp3 文件拖拽到 `Spleeter.exe` 上,或在命令行执行

```
spleeter.exe song.mp3
Spleeter.exe song.mp3
```

即可将 song.mp3 分离为人声 (song.vocals.mp3) 和伴奏 (song.accompaniment.mp3) 两个音轨。

更多参数请查看帮助和使用示例。

如果运行时报告缺少 DLL 文件,请安装 [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 (x64)](https://aka.ms/vs/16/release/vc_redist.x64.exe) ([来源页面](https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0))。

## 3. 帮助和更多示例
## 3. 帮助和使用示例

```
使用: spleeter [选项] <输入文件路径>
使用: Spleeter.exe [选项] <输入文件路径>
选项:
-m, --model Spleeter 模型名称
(2stems, 4stems, 5stems-16kHz, ..., 默认值: 2stems)
-o, --output 输出基础文件名
(格式为 文件名.扩展名,默认值: <输入文件路径>)
-b, --bitrate 输出文件的比特率
(128k, 192000, 256k, ..., 默认值: 256k)
-m, --model Spleeter 模型名称 (也就是 models 目录中的子目录名)
2stems, 4stems, 5stems-22khz, ..., 默认为 2stems
-o, --output 输出文件路径格式
默认为空,等效于 $(DirPath)\$(BaseName).$(TrackName).$(Ext)
支持的变量名和相应的示例值如下:
$(FullPath) D:\Music\test.mp3
$(DirPath) D:\Music
$(FileName) test.mp3
$(BaseName) test
$(Ext) mp3
$(TrackName) vocals,drums,bass,...
-b, --bitrate 输出文件的比特率 (对于无损或恒定量化值的编码,不会被使用)
128k, 192000, 256k, ..., 默认为 256k
-t, --tracks 输出轨道列表 (逗号分隔的轨道名称列表)
默认为空,输出所有轨道
可用的轨道名称:
input, vocals, accompaniment, drums, bass, piano, other
示例:
accompaniment 只输出伴奏轨道 (使用 2stems 模型时)
vocals,drums 输出人声和鼓两个轨道
mixed=vocals+drums 将人声和鼓混合为一个名为 mixed 的轨道输出
vocals,acc=input-vocals 在使用 4stems 模型时,输出人声和伴奏轨道
--overwrite 当目标输出文件已存在时直接覆盖
--verbose 显示详细的处理过程信息
--debug 显示调试信息
-h, --help 显示帮助文本并退出
-v, --version 显示程序版本号并退出
示例:
spleeter -m 2stems song.mp3
Spleeter.exe -m 2stems song.mp3
- 将 song.mp3 分离为 2 个音轨: vocals, accompaniment (人声,伴奏)
- 输出 2 个文件: song.vocals.mp3, song.accompaniment.mp3
- 输出文件使用和输入相同的 MP3 格式,比特率为默认的 256kbps
spleeter -m 4stems -o result.m4a -b 192k song.mp3
Spleeter.exe -m 4stems -o result.m4a -b 192k song.mp3
- 将 song.mp3 分离为 4 个音轨: vocals, drums, bass, other (人声,鼓,贝斯,其它)
- 输出 4 个文件: result.vocals.m4a, result.drums.m4a, ...
- 输出文件使用 M4A 格式,比特率为 192kbps
spleeter --model 5stems-16kHz --bitrate 320000 song.mp3
Spleeter.exe --model 5stems-22khz --bitrate 320000 song.mp3
- 使用长选项 (long option) 参数的示例
- 使用最高到 16kHz 的精细模型,将 song.mp3 分离为 5 个音轨
- 使用频率上限为 22kHz 的模型,将 song.mp3 分离为 5 个音轨
```

## 4. 致谢
Expand Down
4 changes: 2 additions & 2 deletions bin/x64/Release/models/download_models.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ if exist "models-all.zip" (
echo File models-all.zip is already existed
echo.
) else (
echo URL: https://github.com/wudicgi/SpleeterMsvcExe/releases/download/models-v1.0/models-all.zip
echo URL: https://github.com/wudicgi/SpleeterMsvcExe/releases/download/v2.0/models-all.zip
echo.
wget -O "models-all.zip" "https://github.com/wudicgi/SpleeterMsvcExe/releases/download/models-v1.0/models-all.zip"
wget -O "models-all.zip" "https://github.com/wudicgi/SpleeterMsvcExe/releases/download/v2.0/models-all.zip"
if %ERRORLEVEL% neq 0 goto error_occurred
)

Expand Down
8 changes: 4 additions & 4 deletions version.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#define PROGRAM_COMPANY "Wudi Labs"
#define PROGRAM_COPYRIGHT "Copyright (C) 2021 Wudi <wudi@wudilabs.org>"
#define PROGRAM_WEBSITE "http://www.wudilabs.org/"
#define PROGRAM_COPYRIGHT "Copyright (C) 2021 Wudi <wudi@wudilabs.com>"
#define PROGRAM_WEBSITE "https://www.wudilabs.com/"

#define PROGRAM_NAME "Spleeter CLI"
#define PROGRAM_FILE_NAME "Spleeter.exe"

#define PROGRAM_VERSION "1.0.0.0"
#define PROGRAM_VERSION_2 1,0,0,0
#define PROGRAM_VERSION "2.0.0.0"
#define PROGRAM_VERSION_2 2,0,0,0

0 comments on commit 9624d7b

Please sign in to comment.