@digipair/skill-web-voice-activity-detection 0.65.0-alpha4 → 0.65.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/index.cjs.js CHANGED
@@ -27,6 +27,8 @@ async function addScript(src) {
27
27
  }
28
28
  let VADService = class VADService {
29
29
  async listen(params, _pinsSettingsList, context) {
30
+ const globalInstance = typeof window === 'undefined' ? global : window;
31
+ const config = globalInstance.__DIGIPAIR_CONFIG__;
30
32
  const { stream = await navigator.mediaDevices.getUserMedia({
31
33
  audio: {
32
34
  channelCount: 1,
@@ -34,7 +36,7 @@ let VADService = class VADService {
34
36
  autoGainControl: true,
35
37
  noiseSuppression: true
36
38
  }
37
- }), onFrameProcessed = [], onVADMisfire = [], onSpeechStart = [], onSpeechEnd = [], model = 'legacy', additionalAudioConstraints = {}, baseAssetPath = 'https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/', onnxWASMBasePath = 'https://cdn.jsdelivr.net/npm/onnxruntime-web@1.18.0/dist/', submitUserSpeechOnPause = false, positiveSpeechThreshold = 0.5, negativeSpeechThreshold = 0.35, preSpeechPadFrames = 1, redemptionFrames = 8, frameSamples = 1536, minSpeechFrames = 3 } = params;
39
+ }), onFrameProcessed = [], onVADMisfire = [], onSpeechStart = [], onSpeechEnd = [], model = 'legacy', additionalAudioConstraints = {}, baseAssetPath = `${config.BASE_URL}/@ricky0123/vad-web@0.0.22/dist/`, onnxWASMBasePath = `${config.BASE_URL}/onnxruntime-web@1.18.0/dist/`, submitUserSpeechOnPause = false, positiveSpeechThreshold = 0.5, negativeSpeechThreshold = 0.35, preSpeechPadFrames = 1, redemptionFrames = 8, frameSamples = 1536, minSpeechFrames = 3 } = params;
38
40
  if (!document.querySelector(`script[src="${onnxWASMBasePath}ort.js"]`)) {
39
41
  await addScript(`${onnxWASMBasePath}ort.js`);
40
42
  }
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, tokens = tokens1, nextMatch = nextMatch1, {
23902
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
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, tokens = tokens1, nextMatch = nextMatch1, "continue";
23909
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "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, tokens = tokens1, nextMatch = nextMatch1, "continue";
23928
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "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, tokens = tokens1, nextMatch = nextMatch1, "continue";
23947
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23948
23948
  }
23949
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23949
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
23950
23950
  v: nextMatch1
23951
23951
  };
23952
23952
  };
@@ -27988,6 +27988,8 @@ async function addScript(src) {
27988
27988
  }
27989
27989
  let VADService = class VADService {
27990
27990
  async listen(params, _pinsSettingsList, context) {
27991
+ const globalInstance = typeof window === 'undefined' ? global : window;
27992
+ const config = globalInstance.__DIGIPAIR_CONFIG__;
27991
27993
  const { stream = await navigator.mediaDevices.getUserMedia({
27992
27994
  audio: {
27993
27995
  channelCount: 1,
@@ -27995,7 +27997,7 @@ let VADService = class VADService {
27995
27997
  autoGainControl: true,
27996
27998
  noiseSuppression: true
27997
27999
  }
27998
- }), onFrameProcessed = [], onVADMisfire = [], onSpeechStart = [], onSpeechEnd = [], model = 'legacy', additionalAudioConstraints = {}, baseAssetPath = 'https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@0.0.22/dist/', onnxWASMBasePath = 'https://cdn.jsdelivr.net/npm/onnxruntime-web@1.18.0/dist/', submitUserSpeechOnPause = false, positiveSpeechThreshold = 0.5, negativeSpeechThreshold = 0.35, preSpeechPadFrames = 1, redemptionFrames = 8, frameSamples = 1536, minSpeechFrames = 3 } = params;
28000
+ }), onFrameProcessed = [], onVADMisfire = [], onSpeechStart = [], onSpeechEnd = [], model = 'legacy', additionalAudioConstraints = {}, baseAssetPath = `${config.BASE_URL}/@ricky0123/vad-web@0.0.22/dist/`, onnxWASMBasePath = `${config.BASE_URL}/onnxruntime-web@1.18.0/dist/`, submitUserSpeechOnPause = false, positiveSpeechThreshold = 0.5, negativeSpeechThreshold = 0.35, preSpeechPadFrames = 1, redemptionFrames = 8, frameSamples = 1536, minSpeechFrames = 3 } = params;
27999
28001
  if (!document.querySelector(`script[src="${onnxWASMBasePath}ort.js"]`)) {
28000
28002
  await addScript(`${onnxWASMBasePath}ort.js`);
28001
28003
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-web-voice-activity-detection",
3
- "version": "0.65.0-alpha4",
3
+ "version": "0.65.1",
4
4
  "keywords": [
5
5
  "digipair",
6
6
  "web"