lookatstudy-termux-voice 0.30.0 → 0.31.1
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 +7 -7
- package/streaming-asr.js +51 -0
- package/types.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lookatstudy-termux-voice",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.1",
|
|
4
4
|
"description": "Speech-to-text, text-to-speech, speaker diarization, and speech enhancement using Next-gen Kaldi without internet connection [termux android-arm64 build with bundled .so]",
|
|
5
5
|
"main": "sherpa-onnx.js",
|
|
6
6
|
"scripts": {
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
},
|
|
58
58
|
"homepage": "https://github.com/csukuangfj/sherpa-onnx#readme",
|
|
59
59
|
"optionalDependencies": {
|
|
60
|
-
"sherpa-onnx-darwin-arm64": "^1.13.
|
|
61
|
-
"sherpa-onnx-darwin-x64": "^1.13.
|
|
62
|
-
"sherpa-onnx-linux-x64": "^1.13.
|
|
63
|
-
"sherpa-onnx-linux-arm64": "^1.13.
|
|
64
|
-
"sherpa-onnx-win-x64": "^1.13.
|
|
65
|
-
"sherpa-onnx-win-ia32": "^1.13.
|
|
60
|
+
"sherpa-onnx-darwin-arm64": "^1.13.8",
|
|
61
|
+
"sherpa-onnx-darwin-x64": "^1.13.8",
|
|
62
|
+
"sherpa-onnx-linux-x64": "^1.13.8",
|
|
63
|
+
"sherpa-onnx-linux-arm64": "^1.13.8",
|
|
64
|
+
"sherpa-onnx-win-x64": "^1.13.8",
|
|
65
|
+
"sherpa-onnx-win-ia32": "^1.13.8"
|
|
66
66
|
},
|
|
67
67
|
"sherpaVersion": "1.13.6"
|
|
68
68
|
}
|
package/streaming-asr.js
CHANGED
|
@@ -53,6 +53,40 @@ class OnlineStream {
|
|
|
53
53
|
inputFinished() {
|
|
54
54
|
addon.inputFinished(this.handle)
|
|
55
55
|
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Set a string option on the underlying online stream.
|
|
59
|
+
*
|
|
60
|
+
* For example, multilingual streaming Nemotron models read the option
|
|
61
|
+
* 'language' (e.g. 'en', 'de') from each stream on every decode call;
|
|
62
|
+
* leaving it unset selects automatic language detection.
|
|
63
|
+
* @param {string} key
|
|
64
|
+
* @param {string} value
|
|
65
|
+
*/
|
|
66
|
+
setOption(key, value) {
|
|
67
|
+
addon.onlineStreamSetOption(this.handle, key, value);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Get a string option of the underlying online stream.
|
|
72
|
+
*
|
|
73
|
+
* Returns an empty string if the option has not been set; use hasOption()
|
|
74
|
+
* to distinguish an unset option from an empty value.
|
|
75
|
+
* @param {string} key
|
|
76
|
+
* @returns {string}
|
|
77
|
+
*/
|
|
78
|
+
getOption(key) {
|
|
79
|
+
return addon.onlineStreamGetOption(this.handle, key);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Check whether an option has been set on the underlying online stream.
|
|
84
|
+
* @param {string} key
|
|
85
|
+
* @returns {boolean}
|
|
86
|
+
*/
|
|
87
|
+
hasOption(key) {
|
|
88
|
+
return addon.onlineStreamHasOption(this.handle, key);
|
|
89
|
+
}
|
|
56
90
|
}
|
|
57
91
|
|
|
58
92
|
/**
|
|
@@ -93,6 +127,23 @@ class OnlineRecognizer {
|
|
|
93
127
|
addon.decodeOnlineStream(this.handle, stream.handle);
|
|
94
128
|
}
|
|
95
129
|
|
|
130
|
+
/**
|
|
131
|
+
* Decode multiple streams of this recognizer in parallel.
|
|
132
|
+
*
|
|
133
|
+
* The caller must ensure every stream in the array is ready for decoding,
|
|
134
|
+
* i.e. isReady() returns true for each of them.
|
|
135
|
+
* @param {OnlineStream[]} streams
|
|
136
|
+
*/
|
|
137
|
+
decodeStreams(streams) {
|
|
138
|
+
const handles = streams.map((stream) => {
|
|
139
|
+
if (!(stream instanceof OnlineStream)) {
|
|
140
|
+
throw new TypeError('Every element should be an OnlineStream');
|
|
141
|
+
}
|
|
142
|
+
return stream.handle;
|
|
143
|
+
});
|
|
144
|
+
addon.decodeMultipleOnlineStreams(this.handle, handles);
|
|
145
|
+
}
|
|
146
|
+
|
|
96
147
|
/**
|
|
97
148
|
* Check endpoint condition for a stream.
|
|
98
149
|
* @param {OnlineStream} stream
|
package/types.js
CHANGED
|
@@ -739,6 +739,7 @@
|
|
|
739
739
|
* @property {number[]} context_scores
|
|
740
740
|
* @property {number} segment
|
|
741
741
|
* @property {number[]} words
|
|
742
|
+
* @property {number} num_trailing_blanks
|
|
742
743
|
* @property {number} start_time
|
|
743
744
|
* @property {boolean} is_final
|
|
744
745
|
* @property {boolean} is_eof
|