Metadata-Version: 2.4
Name: novacal
Version: 0.1.0
Summary: Demucs 人声分离命令行工具，支持伴奏导出与轻量音质增强
Author: 刘威
Keywords: demucs,audio,vocals,separation,cli
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Multimedia :: Sound/Audio
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: demucs>=4.0.1
Requires-Dist: soundfile>=0.13.1

# novacal

中文 | [English](#english)

novacal 是一个基于 demucs 的命令行人声分离工具。

- 输入一首歌
- 导出伴奏 `no_vocals`
- 支持 `wav / mp3 / m4a`
- 支持一键轻量音质增强
- 支持实时进度输出

## 中文

### 功能

- 人声分离：调用 demucs 提取 `no_vocals`
- 音质增强：可选 `--enhance`
- 质量预设：`fast / balanced / best`
- 设备选择：`cpu / mps / cuda / auto`
- 实时日志：避免终端看起来卡住

### 安装

#### 1. 安装系统依赖

macOS:

```bash
brew install ffmpeg
brew install libsndfile
```

#### 2. 安装 novacal

```bash
pip install novacal
```

如果你是本地源码开发：

```bash
pip install -e .
```

### 快速开始

最简单用法：

```bash
novacal "song.mp3"
```

开启音质增强：

```bash
novacal "song.mp3" --enhance
```

更高质量：

```bash
novacal "song.mp3" --quality best --enhance
```

导出 mp3：

```bash
novacal "song.mp3" -o "song_no_vocals.mp3" --enhance
```

如果命令不可用，也可以这样运行：

```bash
python -m novacal "song.mp3" --enhance
```

### 常用参数

- `--quality fast|balanced|best`：质量预设
- `--shifts N`：手动指定 demucs shifts
- `--device cpu|mps|cuda|auto`：计算设备
- `--float32`：更稳但可能更慢
- `--enhance`：导出时做轻量后处理
- `--debug`：打印完整错误堆栈

### 输出格式

支持以下输出后缀：

- `.wav`
- `.mp3`
- `.m4a`

默认输出命名：

- `原文件名_no_vocals.wav`

### 不支持

- `.ncm`

`.ncm` 是加密格式，不是标准音频容器，demucs 和 ffmpeg 无法直接处理。

### 常见问题

#### 1. 提示缺少 ffmpeg

请先安装：

```bash
brew install ffmpeg
```

#### 2. 提示 torchaudio 没有可用 backend

请安装：

```bash
brew install libsndfile
pip install -U soundfile
```

#### 3. 运行很慢

- 第一次运行可能需要初始化模型
- `best` 会更慢，但通常更干净
- Apple Silicon 可尝试 `--device mps`

### 发布

构建：

```bash
python -m build
```

上传：

```bash
python -m twine upload dist/*
```

---

## English

novacal is a command-line vocal separation tool powered by demucs.

- Input a song
- Export the accompaniment as `no_vocals`
- Support `wav / mp3 / m4a`
- Optional one-click enhancement
- Real-time progress output

### Features

- Vocal separation with demucs
- Optional enhancement via `--enhance`
- Quality presets: `fast / balanced / best`
- Device selection: `cpu / mps / cuda / auto`
- Streaming logs for better CLI feedback

### Installation

#### 1. Install system dependencies

macOS:

```bash
brew install ffmpeg
brew install libsndfile
```

#### 2. Install novacal

```bash
pip install novacal
```

For local development:

```bash
pip install -e .
```

### Quick Start

Basic usage:

```bash
novacal "song.mp3"
```

Enable enhancement:

```bash
novacal "song.mp3" --enhance
```

Use better quality:

```bash
novacal "song.mp3" --quality best --enhance
```

Export mp3:

```bash
novacal "song.mp3" -o "song_no_vocals.mp3" --enhance
```

If the shell command is not available, use:

```bash
python -m novacal "song.mp3" --enhance
```

### Common Options

- `--quality fast|balanced|best`
- `--shifts N`
- `--device cpu|mps|cuda|auto`
- `--float32`
- `--enhance`
- `--debug`

### Supported Output Formats

- `.wav`
- `.mp3`
- `.m4a`

Default output:

- `original_name_no_vocals.wav`

### Unsupported

- `.ncm`

`.ncm` is an encrypted format, not a standard audio container, so it cannot be processed directly by demucs or ffmpeg.

### Build and Publish

Build:

```bash
python -m build
```

Upload:

```bash
python -m twine upload dist/*
```
