@digipair/skill-web-voice-activity-detection 0.58.4 → 0.58.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/index.cjs.js +12 -8
- package/index.esm.js +17 -14
- package/package.json +1 -1
- package/schema.fr.json +25 -10
- package/schema.json +25 -10
- package/src/lib/skill-web-voice-activity-detection.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -27,7 +27,7 @@ let VADService = class VADService {
|
|
|
27
27
|
autoGainControl: true,
|
|
28
28
|
noiseSuppression: true
|
|
29
29
|
}
|
|
30
|
-
}),
|
|
30
|
+
}), startOnLoad = true, onFrameProcessed = [], onVADMisfire = [], onSpeechStart = [], onSpeechEnd = [], model = 'v5', positiveSpeechThreshold = 0.4, negativeSpeechThreshold = 0.4, minSpeechFrames = 15, preSpeechPadFrames = 30, additionalAudioConstraints = {}, redemptionFrames = 24, frameSamples = 512, baseAssetPath = 'https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/', onnxWASMBasePath = 'https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/' } = params;
|
|
31
31
|
const vad = await MicVAD.new({
|
|
32
32
|
stream,
|
|
33
33
|
onFrameProcessed: (probabilities, frame)=>{
|
|
@@ -53,6 +53,7 @@ let VADService = class VADService {
|
|
|
53
53
|
vad
|
|
54
54
|
}));
|
|
55
55
|
},
|
|
56
|
+
startOnLoad,
|
|
56
57
|
additionalAudioConstraints,
|
|
57
58
|
positiveSpeechThreshold,
|
|
58
59
|
negativeSpeechThreshold,
|
|
@@ -64,24 +65,27 @@ let VADService = class VADService {
|
|
|
64
65
|
baseAssetPath,
|
|
65
66
|
onnxWASMBasePath
|
|
66
67
|
});
|
|
67
|
-
await engine.executePinsList(onLoad, _extends({}, context, {
|
|
68
|
-
vad
|
|
69
|
-
}));
|
|
70
68
|
return vad;
|
|
71
69
|
}
|
|
72
70
|
async start(params, _pinsSettingsList, context) {
|
|
73
|
-
const {
|
|
74
|
-
return
|
|
71
|
+
const { vad = context.vad } = params;
|
|
72
|
+
return vad.start();
|
|
75
73
|
}
|
|
76
74
|
async pause(params, _pinsSettingsList, context) {
|
|
77
|
-
const {
|
|
78
|
-
return
|
|
75
|
+
const { vad = context.vad } = params;
|
|
76
|
+
return vad.pause();
|
|
77
|
+
}
|
|
78
|
+
async destroy(params, _pinsSettingsList, context) {
|
|
79
|
+
const { vad = context.vad } = params;
|
|
80
|
+
return vad.destroy();
|
|
79
81
|
}
|
|
80
82
|
};
|
|
81
83
|
const listen = (params, pinsSettingsList, context)=>new VADService().listen(params, pinsSettingsList, context);
|
|
82
84
|
const start = (params, pinsSettingsList, context)=>new VADService().start(params, pinsSettingsList, context);
|
|
83
85
|
const pause = (params, pinsSettingsList, context)=>new VADService().pause(params, pinsSettingsList, context);
|
|
86
|
+
const destroy = (params, pinsSettingsList, context)=>new VADService().destroy(params, pinsSettingsList, context);
|
|
84
87
|
|
|
88
|
+
exports.destroy = destroy;
|
|
85
89
|
exports.listen = listen;
|
|
86
90
|
exports.pause = pause;
|
|
87
91
|
exports.start = start;
|
package/index.esm.js
CHANGED
|
@@ -23899,14 +23899,14 @@ function indent(str, spaces) {
|
|
|
23899
23899
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
|
23900
23900
|
// match is required
|
|
23901
23901
|
if (!match) {
|
|
23902
|
-
return i = i1,
|
|
23902
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
|
|
23903
23903
|
v: nextMatch1
|
|
23904
23904
|
};
|
|
23905
23905
|
}
|
|
23906
23906
|
var token = match.token, offset = match.offset;
|
|
23907
23907
|
i1 += offset;
|
|
23908
23908
|
if (token === " ") {
|
|
23909
|
-
return i = i1,
|
|
23909
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
|
|
23910
23910
|
}
|
|
23911
23911
|
tokens1 = _to_consumable_array$1(tokens1).concat([
|
|
23912
23912
|
token
|
|
@@ -23925,7 +23925,7 @@ function indent(str, spaces) {
|
|
|
23925
23925
|
if (contextKeys.some(function(el) {
|
|
23926
23926
|
return el.startsWith(name);
|
|
23927
23927
|
})) {
|
|
23928
|
-
return i = i1,
|
|
23928
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
|
|
23929
23929
|
}
|
|
23930
23930
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23931
23931
|
return el === name;
|
|
@@ -23944,9 +23944,9 @@ function indent(str, spaces) {
|
|
|
23944
23944
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23945
23945
|
return el.startsWith(name);
|
|
23946
23946
|
})) {
|
|
23947
|
-
return i = i1,
|
|
23947
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
|
|
23948
23948
|
}
|
|
23949
|
-
return i = i1,
|
|
23949
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
|
|
23950
23950
|
v: nextMatch1
|
|
23951
23951
|
};
|
|
23952
23952
|
};
|
|
@@ -27965,7 +27965,7 @@ let VADService = class VADService {
|
|
|
27965
27965
|
autoGainControl: true,
|
|
27966
27966
|
noiseSuppression: true
|
|
27967
27967
|
}
|
|
27968
|
-
}),
|
|
27968
|
+
}), startOnLoad = true, onFrameProcessed = [], onVADMisfire = [], onSpeechStart = [], onSpeechEnd = [], model = 'v5', positiveSpeechThreshold = 0.4, negativeSpeechThreshold = 0.4, minSpeechFrames = 15, preSpeechPadFrames = 30, additionalAudioConstraints = {}, redemptionFrames = 24, frameSamples = 512, baseAssetPath = 'https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/', onnxWASMBasePath = 'https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/' } = params;
|
|
27969
27969
|
const vad = await MicVAD.new({
|
|
27970
27970
|
stream,
|
|
27971
27971
|
onFrameProcessed: (probabilities, frame)=>{
|
|
@@ -27991,6 +27991,7 @@ let VADService = class VADService {
|
|
|
27991
27991
|
vad
|
|
27992
27992
|
}));
|
|
27993
27993
|
},
|
|
27994
|
+
startOnLoad,
|
|
27994
27995
|
additionalAudioConstraints,
|
|
27995
27996
|
positiveSpeechThreshold,
|
|
27996
27997
|
negativeSpeechThreshold,
|
|
@@ -28002,22 +28003,24 @@ let VADService = class VADService {
|
|
|
28002
28003
|
baseAssetPath,
|
|
28003
28004
|
onnxWASMBasePath
|
|
28004
28005
|
});
|
|
28005
|
-
await executePinsList(onLoad, _extends({}, context, {
|
|
28006
|
-
vad
|
|
28007
|
-
}));
|
|
28008
28006
|
return vad;
|
|
28009
28007
|
}
|
|
28010
28008
|
async start(params, _pinsSettingsList, context) {
|
|
28011
|
-
const {
|
|
28012
|
-
return
|
|
28009
|
+
const { vad = context.vad } = params;
|
|
28010
|
+
return vad.start();
|
|
28013
28011
|
}
|
|
28014
28012
|
async pause(params, _pinsSettingsList, context) {
|
|
28015
|
-
const {
|
|
28016
|
-
return
|
|
28013
|
+
const { vad = context.vad } = params;
|
|
28014
|
+
return vad.pause();
|
|
28015
|
+
}
|
|
28016
|
+
async destroy(params, _pinsSettingsList, context) {
|
|
28017
|
+
const { vad = context.vad } = params;
|
|
28018
|
+
return vad.destroy();
|
|
28017
28019
|
}
|
|
28018
28020
|
};
|
|
28019
28021
|
const listen = (params, pinsSettingsList, context)=>new VADService().listen(params, pinsSettingsList, context);
|
|
28020
28022
|
const start = (params, pinsSettingsList, context)=>new VADService().start(params, pinsSettingsList, context);
|
|
28021
28023
|
const pause = (params, pinsSettingsList, context)=>new VADService().pause(params, pinsSettingsList, context);
|
|
28024
|
+
const destroy = (params, pinsSettingsList, context)=>new VADService().destroy(params, pinsSettingsList, context);
|
|
28022
28025
|
|
|
28023
|
-
export { listen, pause, start };
|
|
28026
|
+
export { destroy, listen, pause, start };
|
package/package.json
CHANGED
package/schema.fr.json
CHANGED
|
@@ -44,23 +44,29 @@
|
|
|
44
44
|
"x-events": []
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
-
"/
|
|
47
|
+
"/destroy": {
|
|
48
48
|
"post": {
|
|
49
49
|
"tags": ["web"],
|
|
50
|
-
"summary": "
|
|
50
|
+
"summary": "Détruit détection vocale",
|
|
51
51
|
"parameters": [
|
|
52
52
|
{
|
|
53
|
-
"name": "
|
|
54
|
-
"summary": "
|
|
53
|
+
"name": "vad",
|
|
54
|
+
"summary": "Instance",
|
|
55
55
|
"required": false,
|
|
56
|
-
"description": "
|
|
56
|
+
"description": "Instance de détection vocale",
|
|
57
57
|
"schema": {
|
|
58
|
-
"type": "
|
|
59
|
-
"items": {
|
|
60
|
-
"$ref": "https://schemas.digipair.ai/pinsSettings"
|
|
61
|
-
}
|
|
58
|
+
"type": "string"
|
|
62
59
|
}
|
|
63
|
-
}
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"x-events": []
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"/listen": {
|
|
66
|
+
"post": {
|
|
67
|
+
"tags": ["web"],
|
|
68
|
+
"summary": "Écoute la détection vocale",
|
|
69
|
+
"parameters": [
|
|
64
70
|
{
|
|
65
71
|
"name": "onFrameProcessed",
|
|
66
72
|
"summary": "Traitement de trame",
|
|
@@ -118,6 +124,15 @@
|
|
|
118
124
|
"type": "string"
|
|
119
125
|
}
|
|
120
126
|
},
|
|
127
|
+
{
|
|
128
|
+
"name": "startOnLoad",
|
|
129
|
+
"summary": "Démarrage au chargement",
|
|
130
|
+
"required": false,
|
|
131
|
+
"description": "Démarrage de la détection vocale au chargement",
|
|
132
|
+
"schema": {
|
|
133
|
+
"type": "boolean"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
121
136
|
{
|
|
122
137
|
"name": "positiveSpeechThreshold",
|
|
123
138
|
"summary": "Seuil de parole positif",
|
package/schema.json
CHANGED
|
@@ -44,23 +44,29 @@
|
|
|
44
44
|
"x-events": []
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
-
"/
|
|
47
|
+
"/destroy": {
|
|
48
48
|
"post": {
|
|
49
49
|
"tags": ["web"],
|
|
50
|
-
"summary": "
|
|
50
|
+
"summary": "Destroy voice detection",
|
|
51
51
|
"parameters": [
|
|
52
52
|
{
|
|
53
|
-
"name": "
|
|
54
|
-
"summary": "
|
|
53
|
+
"name": "vad",
|
|
54
|
+
"summary": "Instance",
|
|
55
55
|
"required": false,
|
|
56
|
-
"description": "
|
|
56
|
+
"description": "Voice detection instance",
|
|
57
57
|
"schema": {
|
|
58
|
-
"type": "
|
|
59
|
-
"items": {
|
|
60
|
-
"$ref": "https://schemas.digipair.ai/pinsSettings"
|
|
61
|
-
}
|
|
58
|
+
"type": "string"
|
|
62
59
|
}
|
|
63
|
-
}
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"x-events": []
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"/listen": {
|
|
66
|
+
"post": {
|
|
67
|
+
"tags": ["web"],
|
|
68
|
+
"summary": "Listen to voice detection",
|
|
69
|
+
"parameters": [
|
|
64
70
|
{
|
|
65
71
|
"name": "onFrameProcessed",
|
|
66
72
|
"summary": "Frame processing",
|
|
@@ -118,6 +124,15 @@
|
|
|
118
124
|
"type": "string"
|
|
119
125
|
}
|
|
120
126
|
},
|
|
127
|
+
{
|
|
128
|
+
"name": "startOnLoad",
|
|
129
|
+
"summary": "Start on load",
|
|
130
|
+
"required": false,
|
|
131
|
+
"description": "Start voice detection on load",
|
|
132
|
+
"schema": {
|
|
133
|
+
"type": "boolean"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
121
136
|
{
|
|
122
137
|
"name": "positiveSpeechThreshold",
|
|
123
138
|
"summary": "Positive speech threshold",
|
|
@@ -2,3 +2,4 @@ import { PinsSettings } from '@digipair/engine';
|
|
|
2
2
|
export declare const listen: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
3
3
|
export declare const start: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
4
4
|
export declare const pause: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
5
|
+
export declare const destroy: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|