@gjsify/speech-recognition 0.64.61 → 0.64.62-next.380
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/lib/esm/backend.js +1 -1
- package/package.json +12 -11
package/lib/esm/backend.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{getLoadError as e,hasNativeSherpa as t,loadNativeSherpa as n}from"@gjsify/sherpa-native";import{hostOs as r}from"@gjsify/utils/core";function hasRecognitionBackend(){let e=r();return e===`darwin`||e===`win32`?!1:t()}function describeRecognitionBackend(){if(!hasRecognitionBackend()){let t=e();return`none: @gjsify/sherpa-native is not available on this host${t?` (${t.message})`:``}`}let t=n();return`sherpa-onnx ${t.version()} on onnxruntime ${t.onnxruntime_version()} (@gjsify/sherpa-native)`}function createSherpaEngine(e){let t=n();if(t===null)throw Error(describeRecognitionBackend());let r=new t.OnlineRecognizer({encoder:e.encoder,decoder:e.decoder,joiner:e.joiner,tokens:e.tokens,sample_rate:e.sampleRate,num_threads:e.numThreads??1,enable_endpoint:!0}),i=null,feed=t=>{let n=i;for(n.accept(e.sampleRate,t);n.is_ready();)n.decode();return{text:n.get_text(),endpoint:n.is_endpoint()}};return{open(){r.open(),i??=r.create_stream(null)},accept:feed,flushTail(){return feed(new Float32Array(Math.round(e.sampleRate
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{getLoadError as e,hasNativeSherpa as t,loadNativeSherpa as n}from"@gjsify/sherpa-native";import{hostOs as r}from"@gjsify/utils/core";function hasRecognitionBackend(){let e=r();return e===`darwin`||e===`win32`?!1:t()}function describeRecognitionBackend(){if(!hasRecognitionBackend()){let t=e();return`none: @gjsify/sherpa-native is not available on this host${t?` (${t.message})`:``}`}let t=n();return`sherpa-onnx ${t.version()} on onnxruntime ${t.onnxruntime_version()} (@gjsify/sherpa-native)`}function createSherpaEngine(e){let t=n();if(t===null)throw Error(describeRecognitionBackend());let r=new t.OnlineRecognizer({encoder:e.encoder,decoder:e.decoder,joiner:e.joiner,tokens:e.tokens,sample_rate:e.sampleRate,num_threads:e.numThreads??1,enable_endpoint:!0}),i=null,feed=t=>{let n=i;for(n.accept(e.sampleRate,t);n.is_ready();)n.decode();return{text:n.get_text(),endpoint:n.is_endpoint()}};return{open(){r.open(),i??=r.create_stream(null)},accept:feed,flushTail(){return feed(new Float32Array(Math.round(e.sampleRate*1.5)))},detail(){try{let e=JSON.parse(i.get_json());return{tokens:e.tokens??[],timestamps:e.timestamps??[],logProbs:e.ys_probs??[]}}catch{return{tokens:[],timestamps:[],logProbs:[]}}},reset(){i.reset()},close(){i?.close(),i=null,r.close()}}}export{createSherpaEngine,describeRecognitionBackend,hasRecognitionBackend};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/speech-recognition",
|
|
3
|
-
"version": "0.64.
|
|
3
|
+
"version": "0.64.62-next.380",
|
|
4
4
|
"description": "Web Speech recognition API (SpeechRecognition and its event and result classes) for GJS, running fully on the device: a streaming zipformer on sherpa-onnx, fed by @gjsify/media-capture and endpointed by @gjsify/vad, plus transcribe() for finished recordings on an offline Parakeet model. Models are fetched on first use, never bundled.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -45,19 +45,19 @@
|
|
|
45
45
|
"zipformer"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@gjsify/dom-events": "0.64.
|
|
49
|
-
"@gjsify/media-capture": "0.64.
|
|
50
|
-
"@gjsify/model-store": "0.64.
|
|
51
|
-
"@gjsify/node-globals": "0.64.
|
|
52
|
-
"@gjsify/sherpa-native": "0.64.
|
|
53
|
-
"@gjsify/utils": "0.64.
|
|
54
|
-
"@gjsify/vad": "0.64.
|
|
48
|
+
"@gjsify/dom-events": "0.64.62-next.380",
|
|
49
|
+
"@gjsify/media-capture": "0.64.62-next.380",
|
|
50
|
+
"@gjsify/model-store": "0.64.62-next.380",
|
|
51
|
+
"@gjsify/node-globals": "0.64.62-next.380",
|
|
52
|
+
"@gjsify/sherpa-native": "0.64.62-next.380",
|
|
53
|
+
"@gjsify/utils": "0.64.62-next.380",
|
|
54
|
+
"@gjsify/vad": "0.64.62-next.380"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@girs/gjs": "5.4.0",
|
|
58
58
|
"@girs/glib-2.0": "5.4.0",
|
|
59
|
-
"@gjsify/cli": "0.64.
|
|
60
|
-
"@gjsify/unit": "0.64.
|
|
59
|
+
"@gjsify/cli": "0.64.62-next.380",
|
|
60
|
+
"@gjsify/unit": "0.64.62-next.380",
|
|
61
61
|
"@types/node": "^25.9.2",
|
|
62
62
|
"typescript": "^6.0.3"
|
|
63
63
|
},
|
|
@@ -89,5 +89,6 @@
|
|
|
89
89
|
"bugs": {
|
|
90
90
|
"url": "https://github.com/gjsify/gjsify/issues"
|
|
91
91
|
},
|
|
92
|
-
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/web/speech-recognition#readme"
|
|
92
|
+
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/web/speech-recognition#readme",
|
|
93
|
+
"gitHead": "c272d48beed3adecf77071e42bd235dda37f1827"
|
|
93
94
|
}
|