Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

AudioSeparationKit

On-device GPU-accelerated music source separation for Apple platforms, powered by Demucs and MLX.

Separates audio into individual stems (drums, bass, vocals, guitar, piano, etc.) entirely on Apple Silicon — no server required.

Requirements

  • macOS 14+ / iOS 17+
  • Apple Silicon (M1 or later)
  • Swift 6.0+

Installation

Add to your Package.swift:

dependencies: [ .package(url: "https://github.com/Lakr233/AudioSeparationKit", branch: "master"), ]

Quick Start

import AudioSeparationKit let separator = try AudioSeparator(model: .htdemucs) let result = try await separator.separate(fileAt: audioFileURL) try result.writeStems(to: outputDirectory)

With Progress Reporting

let result = try await separator.separate(fileAt: url) { progress in print("\(Int(progress.fraction * 100))% — \(progress.stage)") }

Custom Options

let options = SeparationOptions( shifts: 2, // ensemble averaging for better quality overlap: 0.25, // segment overlap ratio splitEnabled: true // split long audio into segments ) let result = try await separator.separate(fileAt: url, options: options)

Models

ModelStemsDescription
htdemucs4HTDemucs — default, good balance of speed and quality
htdemucs_ft4HTDemucs Fine-Tuned — best quality
htdemucs_6s6HTDemucs 6-Source — adds guitar and piano stems
hdemucs_mmi4HDemucs MMI
mdx4Music Demixing
mdx_extra4MDX with extra training data
mdx_q4MDX Quantized — lower memory usage
mdx_extra_q4MDX Extra Quantized

Model weights are automatically downloaded from HuggingFace on first use.

4-stem models output: drums, bass, other, vocals

6-stem models output: drums, bass, other, vocals, guitar, piano

Output Formats

Write separated stems in various formats:

try result.writeStems(to: outputDir, format: .wav()) // default try result.writeStems(to: outputDir, format: .flac) try result.writeStems(to: outputDir, format: .alac) try result.writeStems(to: outputDir, format: .aac)

Testing With Local Assets

Real-model integration tests are designed to use local-only assets:

  • Models/ is ignored and intended for local model weights only.
  • AudioFixtures/ is ignored and intended for local test audio only.
  • Test discovery should enumerate fixture files with FileManager rather than hard-coding filenames.

This repository should not be used to redistribute copyrighted evaluation audio.

Licensing And Third-Party Notices

AudioSeparationKit itself is released under the MIT license. See LICENSE.

This repository also contains adapted source code under Sources/DemucsMLX, imported from kylehowells/demucs-mlx-swift. The preserved upstream MIT license text lives in LICENSES/demucs-mlx-swift-LICENSE, with a short notice in LICENSES/README.md.

Model weights downloaded from Hugging Face and any local audio fixtures may be subject to separate licenses, terms, or copyright restrictions from their original authors. If you redistribute weights, derived packages, or test assets, review those upstream terms separately.

License

MIT

关于 About

No description, website, or topics provided.

语言 Languages

Swift98.1%
Shell1.9%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
4
Total Commits
峰值: 4次/周
Less
More

核心贡献者 Contributors