@digipair/skill-web-voice-activity-detection 0.113.0 → 0.114.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/README.md +7 -0
- package/{index.cjs.js → dist/index.cjs.js} +12 -21
- package/{index.esm.js → dist/index.esm.js} +10104 -11556
- package/{libs/skill-web-voice-activity-detection → dist}/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -0
- package/{libs/skill-web-voice-activity-detection → dist}/src/lib/skill-web-voice-activity-detection.d.ts +1 -0
- package/dist/src/lib/skill-web-voice-activity-detection.d.ts.map +1 -0
- package/package.json +26 -5
- package/index.d.ts +0 -1
- /package/{index.cjs.d.ts → dist/index.d.ts} +0 -0
- /package/{schema.fr.json → dist/schema.fr.json} +0 -0
- /package/{schema.json → dist/schema.json} +0 -0
package/README.md
ADDED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var engine = require('@digipair/engine');
|
|
6
4
|
|
|
7
|
-
function _extends() {
|
|
8
|
-
_extends = Object.assign || function assign(target) {
|
|
9
|
-
for(var i = 1; i < arguments.length; i++){
|
|
10
|
-
var source = arguments[i];
|
|
11
|
-
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
12
|
-
}
|
|
13
|
-
return target;
|
|
14
|
-
};
|
|
15
|
-
return _extends.apply(this, arguments);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
5
|
// add a script tag to the document
|
|
19
6
|
async function addScript(src) {
|
|
20
7
|
const script = document.createElement('script');
|
|
@@ -47,30 +34,34 @@ let VADService = class VADService {
|
|
|
47
34
|
const vad = await MicVAD.new({
|
|
48
35
|
stream,
|
|
49
36
|
onFrameProcessed: (probabilities, frame)=>{
|
|
50
|
-
engine.executePinsList(onFrameProcessed,
|
|
37
|
+
engine.executePinsList(onFrameProcessed, {
|
|
38
|
+
...context,
|
|
51
39
|
probabilities,
|
|
52
40
|
frame,
|
|
53
41
|
vad
|
|
54
|
-
}
|
|
42
|
+
}, `${context.__PATH__}.onFrameProcessed`);
|
|
55
43
|
},
|
|
56
44
|
onVADMisfire: ()=>{
|
|
57
|
-
engine.executePinsList(onVADMisfire,
|
|
45
|
+
engine.executePinsList(onVADMisfire, {
|
|
46
|
+
...context,
|
|
58
47
|
vad
|
|
59
|
-
}
|
|
48
|
+
}, `${context.__PATH__}.onVADMisfire`);
|
|
60
49
|
},
|
|
61
50
|
onSpeechStart: ()=>{
|
|
62
|
-
engine.executePinsList(onSpeechStart,
|
|
51
|
+
engine.executePinsList(onSpeechStart, {
|
|
52
|
+
...context,
|
|
63
53
|
vad
|
|
64
|
-
}
|
|
54
|
+
}, `${context.__PATH__}.onSpeechStart`);
|
|
65
55
|
},
|
|
66
56
|
onSpeechEnd: (buffer)=>{
|
|
67
57
|
const wavBuffer = utils.encodeWAV(buffer);
|
|
68
58
|
const base64 = utils.arrayBufferToBase64(wavBuffer);
|
|
69
59
|
const audio = `data:audio/wav;base64,${base64}`;
|
|
70
|
-
engine.executePinsList(onSpeechEnd,
|
|
60
|
+
engine.executePinsList(onSpeechEnd, {
|
|
61
|
+
...context,
|
|
71
62
|
audio,
|
|
72
63
|
vad
|
|
73
|
-
}
|
|
64
|
+
}, `${context.__PATH__}.onSpeechEnd`);
|
|
74
65
|
},
|
|
75
66
|
additionalAudioConstraints,
|
|
76
67
|
positiveSpeechThreshold,
|