@digipair/skill-web-voice-activity-detection 0.58.4 → 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 CHANGED
@@ -27,7 +27,7 @@ let VADService = class VADService {
27
27
  autoGainControl: true,
28
28
  noiseSuppression: true
29
29
  }
30
- }), onLoad = [], onFrameProcessed = [], onVADMisfire = [], onSpeechStart = [], onSpeechEnd = [], model = 'v5', positiveSpeechThreshold = 0.4, negativeSpeechThreshold = 0.4, minSpeechFrames = 15, preSpeechPadFrames = 30, additionalAudioConstraints, redemptionFrames, frameSamples, baseAssetPath, onnxWASMBasePath } = params;
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,9 +65,6 @@ 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) {
@@ -77,11 +75,17 @@ let VADService = class VADService {
77
75
  const { instance = context.vad } = params;
78
76
  return instance.pause();
79
77
  }
78
+ async destroy(params, _pinsSettingsList, context) {
79
+ const { instance = context.vad } = params;
80
+ return instance.destroy();
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, nextMatch = nextMatch1, tokens = tokens1, {
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, nextMatch = nextMatch1, tokens = tokens1, "continue";
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, nextMatch = nextMatch1, tokens = tokens1, "continue";
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, nextMatch = nextMatch1, tokens = tokens1, "continue";
23947
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23948
23948
  }
23949
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
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
- }), onLoad = [], onFrameProcessed = [], onVADMisfire = [], onSpeechStart = [], onSpeechEnd = [], model = 'v5', positiveSpeechThreshold = 0.4, negativeSpeechThreshold = 0.4, minSpeechFrames = 15, preSpeechPadFrames = 30, additionalAudioConstraints, redemptionFrames, frameSamples, baseAssetPath, onnxWASMBasePath } = params;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-web-voice-activity-detection",
3
- "version": "0.58.4",
3
+ "version": "0.58.5",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"
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",
@@ -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>;