sherpa-onnx-node 1.0.7 → 1.0.8
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/addon.js +28 -2
- package/package.json +4 -4
package/addon.js
CHANGED
|
@@ -4,6 +4,7 @@ const possible_paths = [
|
|
|
4
4
|
'../build/Release/sherpa-onnx.node',
|
|
5
5
|
'../build/Debug/sherpa-onnx.node',
|
|
6
6
|
`./node_modules/sherpa-onnx-${platform_arch}/sherpa-onnx.node`,
|
|
7
|
+
`../sherpa-onnx-${platform_arch}/sherpa-onnx.node`,
|
|
7
8
|
];
|
|
8
9
|
|
|
9
10
|
let found = false;
|
|
@@ -20,6 +21,31 @@ for (const p of possible_paths) {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
if (!found) {
|
|
23
|
-
|
|
24
|
-
`Could not find sherpa-onnx. Tried\n\n ${possible_paths.join('\n ')}\n`
|
|
24
|
+
let msg =
|
|
25
|
+
`Could not find sherpa-onnx. Tried\n\n ${possible_paths.join('\n ')}\n`
|
|
26
|
+
if (os.platform() == 'darwin' &&
|
|
27
|
+
!process.env.DYLD_LIBRARY_PATH.includes(
|
|
28
|
+
`node_modules/sherpa-onnx-${platform_arch}`)) {
|
|
29
|
+
msg +=
|
|
30
|
+
'Please remeber to set the following environment variable and try again:\n';
|
|
31
|
+
|
|
32
|
+
msg += `export DYLD_LIBRARY_PATH=${
|
|
33
|
+
process.env.PWD}/node_modules/sherpa-onnx-${platform_arch}`;
|
|
34
|
+
|
|
35
|
+
msg += ':$DYLD_LIBRARY_PATH\n';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (os.platform() == 'linux' &&
|
|
39
|
+
!process.env.LD_LIBRARY_PATH.includes(
|
|
40
|
+
`node_modules/sherpa-onnx-${platform_arch}`)) {
|
|
41
|
+
msg +=
|
|
42
|
+
'Please remeber to set the following environment variable and try again:\n';
|
|
43
|
+
|
|
44
|
+
msg += `export LD_LIBRARY_PATH=${
|
|
45
|
+
process.env.PWD}/node_modules/sherpa-onnx-${platform_arch}`;
|
|
46
|
+
|
|
47
|
+
msg += ':$LD_LIBRARY_PATH\n';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
throw new Error(msg)
|
|
25
51
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sherpa-onnx-node",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Speech-to-text and text-to-speech using Next-gen Kaldi without internet connection",
|
|
5
5
|
"main": "sherpa-onnx.js",
|
|
6
6
|
"scripts": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/csukuangfj/sherpa-onnx#readme",
|
|
47
47
|
"optionalDependencies": {
|
|
48
|
-
"sherpa-onnx-darwin-arm64": "^1.0.
|
|
49
|
-
"sherpa-onnx-darwin-x64": "^1.0.
|
|
50
|
-
"sherpa-onnx-linux-x64": "^1.0.
|
|
48
|
+
"sherpa-onnx-darwin-arm64": "^1.0.8",
|
|
49
|
+
"sherpa-onnx-darwin-x64": "^1.0.8",
|
|
50
|
+
"sherpa-onnx-linux-x64": "^1.0.8"
|
|
51
51
|
}
|
|
52
52
|
}
|