voicecc 1.2.4 → 1.2.6
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/bin/voicecc.js +19 -2
- package/package.json +1 -1
package/bin/voicecc.js
CHANGED
|
@@ -151,9 +151,9 @@ function ensurePython() {
|
|
|
151
151
|
|
|
152
152
|
function ensureVenvModule(systemPython) {
|
|
153
153
|
try {
|
|
154
|
-
execSync(`${systemPython} -c "import
|
|
154
|
+
execSync(`${systemPython} -c "import ensurepip" 2>&1`, { encoding: "utf-8" });
|
|
155
155
|
return;
|
|
156
|
-
} catch { /*
|
|
156
|
+
} catch { /* ensurepip not available — venv creation will fail */ }
|
|
157
157
|
|
|
158
158
|
if (process.platform !== "linux") {
|
|
159
159
|
console.error("ERROR: Python venv module is missing.");
|
|
@@ -195,6 +195,23 @@ function ensurePythonVenv() {
|
|
|
195
195
|
// Step 2: Ensure venv module is available
|
|
196
196
|
ensureVenvModule(systemPython);
|
|
197
197
|
|
|
198
|
+
// Step 2.5: Ensure system libraries needed by Python packages (OpenCV, audio, WebRTC)
|
|
199
|
+
if (process.platform === "linux") {
|
|
200
|
+
const requiredLibs = ["libGL.so.1", "libSM.so.6", "libsndfile.so.1"];
|
|
201
|
+
const missing = requiredLibs.some((lib) => {
|
|
202
|
+
try { execSync(`ldconfig -p | grep ${lib}`, { encoding: "utf-8" }); return false; } catch { return true; }
|
|
203
|
+
});
|
|
204
|
+
if (missing) {
|
|
205
|
+
console.log("Installing system libraries required by Python packages...");
|
|
206
|
+
try {
|
|
207
|
+
linuxInstallPackage("libgl1 libglib2.0-0 libsm6 libxext6 libxrender1 libsndfile1 libportaudio2");
|
|
208
|
+
} catch (err) {
|
|
209
|
+
console.error(`Failed to install system libraries: ${err.message}`);
|
|
210
|
+
process.exit(1);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
198
215
|
// Step 3: Create venv if needed
|
|
199
216
|
if (!existsSync(venvPython)) {
|
|
200
217
|
console.log("Setting up Python environment for voice server...");
|
package/package.json
CHANGED