stemit-cli 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/commands/setup.js +8 -2
- package/src/lib/splitter.js +18 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stemit-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "CLI tool to split audio into stems (vocals/drums/bass/other), analyze BPM & key, and mute/solo tracks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"bin/",
|
|
12
|
-
"src/"
|
|
12
|
+
"src/",
|
|
13
|
+
"README.md"
|
|
13
14
|
],
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">=18"
|
package/src/commands/setup.js
CHANGED
|
@@ -102,18 +102,24 @@ async function ensureDemucsVenv(systemPython) {
|
|
|
102
102
|
|
|
103
103
|
if (demucsCheck.status !== 0) {
|
|
104
104
|
console.log(chalk.cyan(' Installing demucs (one-time setup, may take a minute) …'))
|
|
105
|
-
const install = spawnSync(VENV_PIP, ['install', 'demucs', 'soundfile', 'torchcodec'], {
|
|
105
|
+
const install = spawnSync(VENV_PIP, ['install', 'demucs', 'soundfile', 'torchcodec', 'certifi'], {
|
|
106
106
|
encoding: 'utf8',
|
|
107
107
|
stdio: 'inherit',
|
|
108
108
|
})
|
|
109
109
|
if (install.status !== 0) {
|
|
110
110
|
console.error(chalk.red(
|
|
111
111
|
'\n Failed to install demucs. Try manually:\n' +
|
|
112
|
-
' pip install demucs soundfile torchcodec'
|
|
112
|
+
' pip install demucs soundfile torchcodec certifi'
|
|
113
113
|
))
|
|
114
114
|
process.exit(1)
|
|
115
115
|
}
|
|
116
116
|
console.log(chalk.green(' ✔ demucs installed'))
|
|
117
|
+
} else {
|
|
118
|
+
// Ensure certifi is present even if venv was created without it
|
|
119
|
+
const certifiCheck = spawnSync(VENV_PYTHON, ['-c', 'import certifi'], { encoding: 'utf8', stdio: 'pipe' })
|
|
120
|
+
if (certifiCheck.status !== 0) {
|
|
121
|
+
spawnSync(VENV_PIP, ['install', '--quiet', 'certifi'], { encoding: 'utf8', stdio: 'inherit' })
|
|
122
|
+
}
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
return VENV_PYTHON
|
package/src/lib/splitter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { spawn } from 'child_process'
|
|
1
|
+
import { spawn, execFileSync } from 'child_process'
|
|
2
2
|
import path from 'path'
|
|
3
3
|
import fs from 'fs'
|
|
4
4
|
|
|
@@ -35,8 +35,24 @@ export function splitStems(
|
|
|
35
35
|
) {
|
|
36
36
|
return new Promise((resolve, reject) => {
|
|
37
37
|
const args = ['-m', 'demucs', '-n', model, '--out', outputDir, inputFile]
|
|
38
|
+
|
|
39
|
+
// Resolve certifi's CA bundle path from within the venv (fixes macOS SSL issues)
|
|
40
|
+
let sslCertFile = process.env.SSL_CERT_FILE
|
|
41
|
+
try {
|
|
42
|
+
const certPath = execFileSync(pythonPath, ['-c', 'import certifi; print(certifi.where())'], {
|
|
43
|
+
encoding: 'utf8',
|
|
44
|
+
}).trim()
|
|
45
|
+
if (certPath) sslCertFile = certPath
|
|
46
|
+
} catch {
|
|
47
|
+
// certifi not available — fall back to system SSL
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
const proc = spawn(pythonPath, args, {
|
|
39
|
-
env: {
|
|
51
|
+
env: {
|
|
52
|
+
...process.env,
|
|
53
|
+
TORCHAUDIO_BACKEND: 'soundfile',
|
|
54
|
+
...(sslCertFile ? { SSL_CERT_FILE: sslCertFile, REQUESTS_CA_BUNDLE: sslCertFile } : {}),
|
|
55
|
+
},
|
|
40
56
|
})
|
|
41
57
|
|
|
42
58
|
const stderrLines = []
|