@digipair/skill-web-voice-activity-detection 0.58.3 → 0.58.5
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 +10 -5
- package/index.esm.js +15 -12
- package/package.json +1 -1
- package/schema.fr.json +27 -0
- package/schema.json +27 -0
- package/src/lib/skill-web-voice-activity-detection.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var engine = require('@digipair/engine');
|
|
6
|
-
require('https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/bundle.min.js');
|
|
7
6
|
|
|
8
7
|
function _extends() {
|
|
9
8
|
_extends = Object.assign || function assign(target) {
|
|
@@ -16,6 +15,8 @@ function _extends() {
|
|
|
16
15
|
return _extends.apply(this, arguments);
|
|
17
16
|
}
|
|
18
17
|
|
|
18
|
+
// import 'https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.js';
|
|
19
|
+
// import 'https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/bundle.min.js';
|
|
19
20
|
const { MicVAD } = window['vad'];
|
|
20
21
|
let VADService = class VADService {
|
|
21
22
|
async listen(params, _pinsSettingsList, context) {
|
|
@@ -26,7 +27,7 @@ let VADService = class VADService {
|
|
|
26
27
|
autoGainControl: true,
|
|
27
28
|
noiseSuppression: true
|
|
28
29
|
}
|
|
29
|
-
}),
|
|
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;
|
|
30
31
|
const vad = await MicVAD.new({
|
|
31
32
|
stream,
|
|
32
33
|
onFrameProcessed: (probabilities, frame)=>{
|
|
@@ -52,6 +53,7 @@ let VADService = class VADService {
|
|
|
52
53
|
vad
|
|
53
54
|
}));
|
|
54
55
|
},
|
|
56
|
+
startOnLoad,
|
|
55
57
|
additionalAudioConstraints,
|
|
56
58
|
positiveSpeechThreshold,
|
|
57
59
|
negativeSpeechThreshold,
|
|
@@ -63,9 +65,6 @@ let VADService = class VADService {
|
|
|
63
65
|
baseAssetPath,
|
|
64
66
|
onnxWASMBasePath
|
|
65
67
|
});
|
|
66
|
-
await engine.executePinsList(onLoad, _extends({}, context, {
|
|
67
|
-
vad
|
|
68
|
-
}));
|
|
69
68
|
return vad;
|
|
70
69
|
}
|
|
71
70
|
async start(params, _pinsSettingsList, context) {
|
|
@@ -76,11 +75,17 @@ let VADService = class VADService {
|
|
|
76
75
|
const { instance = context.vad } = params;
|
|
77
76
|
return instance.pause();
|
|
78
77
|
}
|
|
78
|
+
async destroy(params, _pinsSettingsList, context) {
|
|
79
|
+
const { instance = context.vad } = params;
|
|
80
|
+
return instance.destroy();
|
|
81
|
+
}
|
|
79
82
|
};
|
|
80
83
|
const listen = (params, pinsSettingsList, context)=>new VADService().listen(params, pinsSettingsList, context);
|
|
81
84
|
const start = (params, pinsSettingsList, context)=>new VADService().start(params, pinsSettingsList, context);
|
|
82
85
|
const pause = (params, pinsSettingsList, context)=>new VADService().pause(params, pinsSettingsList, context);
|
|
86
|
+
const destroy = (params, pinsSettingsList, context)=>new VADService().destroy(params, pinsSettingsList, context);
|
|
83
87
|
|
|
88
|
+
exports.destroy = destroy;
|
|
84
89
|
exports.listen = listen;
|
|
85
90
|
exports.pause = pause;
|
|
86
91
|
exports.start = start;
|
package/index.esm.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import 'https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/bundle.min.js';
|
|
2
|
-
|
|
3
1
|
function _extends() {
|
|
4
2
|
_extends = Object.assign || function assign(target) {
|
|
5
3
|
for(var i = 1; i < arguments.length; i++){
|
|
@@ -23901,14 +23899,14 @@ function indent(str, spaces) {
|
|
|
23901
23899
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
|
23902
23900
|
// match is required
|
|
23903
23901
|
if (!match) {
|
|
23904
|
-
return
|
|
23902
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
|
|
23905
23903
|
v: nextMatch1
|
|
23906
23904
|
};
|
|
23907
23905
|
}
|
|
23908
23906
|
var token = match.token, offset = match.offset;
|
|
23909
23907
|
i1 += offset;
|
|
23910
23908
|
if (token === " ") {
|
|
23911
|
-
return
|
|
23909
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
|
|
23912
23910
|
}
|
|
23913
23911
|
tokens1 = _to_consumable_array$1(tokens1).concat([
|
|
23914
23912
|
token
|
|
@@ -23927,7 +23925,7 @@ function indent(str, spaces) {
|
|
|
23927
23925
|
if (contextKeys.some(function(el) {
|
|
23928
23926
|
return el.startsWith(name);
|
|
23929
23927
|
})) {
|
|
23930
|
-
return
|
|
23928
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
|
|
23931
23929
|
}
|
|
23932
23930
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23933
23931
|
return el === name;
|
|
@@ -23946,9 +23944,9 @@ function indent(str, spaces) {
|
|
|
23946
23944
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23947
23945
|
return el.startsWith(name);
|
|
23948
23946
|
})) {
|
|
23949
|
-
return
|
|
23947
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
|
|
23950
23948
|
}
|
|
23951
|
-
return
|
|
23949
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
|
|
23952
23950
|
v: nextMatch1
|
|
23953
23951
|
};
|
|
23954
23952
|
};
|
|
@@ -27955,6 +27953,8 @@ const preparePinsSettings = async (settings, context)=>{
|
|
|
27955
27953
|
});
|
|
27956
27954
|
};
|
|
27957
27955
|
|
|
27956
|
+
// import 'https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.js';
|
|
27957
|
+
// import 'https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/bundle.min.js';
|
|
27958
27958
|
const { MicVAD } = window['vad'];
|
|
27959
27959
|
let VADService = class VADService {
|
|
27960
27960
|
async listen(params, _pinsSettingsList, context) {
|
|
@@ -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,9 +28003,6 @@ 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) {
|
|
@@ -28015,9 +28013,14 @@ let VADService = class VADService {
|
|
|
28015
28013
|
const { instance = context.vad } = params;
|
|
28016
28014
|
return instance.pause();
|
|
28017
28015
|
}
|
|
28016
|
+
async destroy(params, _pinsSettingsList, context) {
|
|
28017
|
+
const { instance = context.vad } = params;
|
|
28018
|
+
return instance.destroy();
|
|
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,6 +44,24 @@
|
|
|
44
44
|
"x-events": []
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
+
"/destroy": {
|
|
48
|
+
"post": {
|
|
49
|
+
"tags": ["web"],
|
|
50
|
+
"summary": "Détruit détection vocale",
|
|
51
|
+
"parameters": [
|
|
52
|
+
{
|
|
53
|
+
"name": "vad",
|
|
54
|
+
"summary": "Instance",
|
|
55
|
+
"required": false,
|
|
56
|
+
"description": "Instance de détection vocale",
|
|
57
|
+
"schema": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"x-events": []
|
|
63
|
+
}
|
|
64
|
+
},
|
|
47
65
|
"/listen": {
|
|
48
66
|
"post": {
|
|
49
67
|
"tags": ["web"],
|
|
@@ -118,6 +136,15 @@
|
|
|
118
136
|
"type": "string"
|
|
119
137
|
}
|
|
120
138
|
},
|
|
139
|
+
{
|
|
140
|
+
"name": "startOnLoad",
|
|
141
|
+
"summary": "Démarrage au chargement",
|
|
142
|
+
"required": false,
|
|
143
|
+
"description": "Démarrage de la détection vocale au chargement",
|
|
144
|
+
"schema": {
|
|
145
|
+
"type": "boolean"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
121
148
|
{
|
|
122
149
|
"name": "positiveSpeechThreshold",
|
|
123
150
|
"summary": "Seuil de parole positif",
|
package/schema.json
CHANGED
|
@@ -44,6 +44,24 @@
|
|
|
44
44
|
"x-events": []
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
+
"/destroy": {
|
|
48
|
+
"post": {
|
|
49
|
+
"tags": ["web"],
|
|
50
|
+
"summary": "Destroy voice detection",
|
|
51
|
+
"parameters": [
|
|
52
|
+
{
|
|
53
|
+
"name": "vad",
|
|
54
|
+
"summary": "Instance",
|
|
55
|
+
"required": false,
|
|
56
|
+
"description": "Voice detection instance",
|
|
57
|
+
"schema": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"x-events": []
|
|
63
|
+
}
|
|
64
|
+
},
|
|
47
65
|
"/listen": {
|
|
48
66
|
"post": {
|
|
49
67
|
"tags": ["web"],
|
|
@@ -118,6 +136,15 @@
|
|
|
118
136
|
"type": "string"
|
|
119
137
|
}
|
|
120
138
|
},
|
|
139
|
+
{
|
|
140
|
+
"name": "startOnLoad",
|
|
141
|
+
"summary": "Start on load",
|
|
142
|
+
"required": false,
|
|
143
|
+
"description": "Start voice detection on load",
|
|
144
|
+
"schema": {
|
|
145
|
+
"type": "boolean"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
121
148
|
{
|
|
122
149
|
"name": "positiveSpeechThreshold",
|
|
123
150
|
"summary": "Positive speech threshold",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PinsSettings } from '@digipair/engine';
|
|
2
|
-
import 'https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/bundle.min.js';
|
|
3
2
|
export declare const listen: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
4
3
|
export declare const start: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
5
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>;
|