@infilectai/aira 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +74 -2
- package/bin/aira-capture +0 -0
- package/dist/attribution.d.ts +118 -0
- package/dist/attribution.d.ts.map +1 -0
- package/dist/attribution.js +626 -0
- package/dist/attribution.js.map +1 -0
- package/dist/audio.d.ts +26 -0
- package/dist/audio.d.ts.map +1 -0
- package/dist/audio.js +172 -0
- package/dist/audio.js.map +1 -0
- package/dist/brain.d.ts +11 -0
- package/dist/brain.d.ts.map +1 -0
- package/dist/brain.js +70 -0
- package/dist/brain.js.map +1 -0
- package/dist/capture.d.ts +48 -0
- package/dist/capture.d.ts.map +1 -0
- package/dist/capture.js +195 -0
- package/dist/capture.js.map +1 -0
- package/dist/engine.d.ts +61 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +471 -0
- package/dist/engine.js.map +1 -0
- package/dist/eyes.d.ts +60 -0
- package/dist/eyes.d.ts.map +1 -0
- package/dist/eyes.js +173 -0
- package/dist/eyes.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/lockfile.d.ts +14 -0
- package/dist/lockfile.d.ts.map +1 -0
- package/dist/lockfile.js +38 -0
- package/dist/lockfile.js.map +1 -0
- package/dist/providers.d.ts +162 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/providers.js +374 -0
- package/dist/providers.js.map +1 -0
- package/dist/transport.d.ts +14 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +44 -0
- package/dist/transport.js.map +1 -0
- package/dist/types.d.ts +175 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/vectors.d.ts +10 -0
- package/dist/vectors.d.ts.map +1 -0
- package/dist/vectors.js +66 -0
- package/dist/vectors.js.map +1 -0
- package/native/AiraCapture.swift +1142 -0
- package/native/Info.plist +26 -0
- package/native/NativeMeetingScraper.swift +1277 -0
- package/package.json +84 -4
- package/scripts/build-capture.cjs +57 -0
- package/scripts/postinstall.cjs +29 -0
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
import { encodeWavFromInt16PCM, } from './providers.js';
|
|
2
|
+
/**
|
|
3
|
+
* Rolling-window cross-batch cluster stitcher for any stateless `DiarizationProvider`.
|
|
4
|
+
* Matches local cluster labels across overlapping windows by maximum timeline overlap
|
|
5
|
+
* to produce session-stable anonymous IDs (`S0`, `S1`, ...).
|
|
6
|
+
*/
|
|
7
|
+
export class IncrementalDiarizer {
|
|
8
|
+
windowSeconds;
|
|
9
|
+
hopSeconds;
|
|
10
|
+
nextGlobalId = 0;
|
|
11
|
+
lastBatch = [];
|
|
12
|
+
committedThrough = 0;
|
|
13
|
+
constructor(windowSeconds = 8, hopSeconds = 3) {
|
|
14
|
+
this.windowSeconds = windowSeconds;
|
|
15
|
+
this.hopSeconds = hopSeconds;
|
|
16
|
+
}
|
|
17
|
+
async process(provider, pcmWindow, windowStart) {
|
|
18
|
+
const wav = encodeWavFromInt16PCM(pcmWindow, 16000);
|
|
19
|
+
const result = await provider.diarize(wav);
|
|
20
|
+
const local = result.segments
|
|
21
|
+
.filter((s) => s.speaker && !s.speaker.endsWith('_NA') && !s.speaker.endsWith('_MIXED'))
|
|
22
|
+
.map((s) => ({
|
|
23
|
+
t0: s.start + windowStart,
|
|
24
|
+
t1: s.end + windowStart,
|
|
25
|
+
localKey: s.speaker,
|
|
26
|
+
}));
|
|
27
|
+
const mapping = new Map();
|
|
28
|
+
if (this.lastBatch.length > 0) {
|
|
29
|
+
const overlapByLocal = new Map();
|
|
30
|
+
for (const s of local) {
|
|
31
|
+
for (const p of this.lastBatch) {
|
|
32
|
+
const o = Math.max(0, Math.min(s.t1, p.t1) - Math.max(s.t0, p.t0));
|
|
33
|
+
if (o > 0) {
|
|
34
|
+
let candidates = overlapByLocal.get(s.localKey);
|
|
35
|
+
if (!candidates) {
|
|
36
|
+
candidates = new Map();
|
|
37
|
+
overlapByLocal.set(s.localKey, candidates);
|
|
38
|
+
}
|
|
39
|
+
candidates.set(p.globalId, (candidates.get(p.globalId) ?? 0) + o);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
for (const [lkey, candidates] of overlapByLocal.entries()) {
|
|
44
|
+
let bestId = -1;
|
|
45
|
+
let bestScore = -1;
|
|
46
|
+
for (const [gid, score] of candidates.entries()) {
|
|
47
|
+
if (score > bestScore) {
|
|
48
|
+
bestScore = score;
|
|
49
|
+
bestId = gid;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (bestId >= 0)
|
|
53
|
+
mapping.set(lkey, bestId);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
for (const s of local) {
|
|
57
|
+
if (!mapping.has(s.localKey)) {
|
|
58
|
+
mapping.set(s.localKey, this.nextGlobalId++);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const global = local.map((s) => ({
|
|
62
|
+
t0: s.t0,
|
|
63
|
+
t1: s.t1,
|
|
64
|
+
globalId: mapping.get(s.localKey),
|
|
65
|
+
}));
|
|
66
|
+
const commitEnd = windowStart + this.hopSeconds;
|
|
67
|
+
const committed = global
|
|
68
|
+
.filter((g) => g.t1 <= commitEnd && g.t0 >= this.committedThrough)
|
|
69
|
+
.map((g) => ({
|
|
70
|
+
t0: g.t0,
|
|
71
|
+
t1: g.t1,
|
|
72
|
+
speakerId: `S${g.globalId}`,
|
|
73
|
+
}));
|
|
74
|
+
this.committedThrough = Math.max(this.committedThrough, commitEnd);
|
|
75
|
+
this.lastBatch = global;
|
|
76
|
+
return committed;
|
|
77
|
+
}
|
|
78
|
+
speakerAt(t) {
|
|
79
|
+
for (let i = this.lastBatch.length - 1; i >= 0; i--) {
|
|
80
|
+
const s = this.lastBatch[i];
|
|
81
|
+
if (t >= s.t0 && t <= s.t1) {
|
|
82
|
+
return `S${s.globalId}`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Maintains the Recall-style speaker timeline (`speakerSpans`), audio energy history,
|
|
90
|
+
* and diarization cluster map (`speakerMap`) to attribute any `[t0, t1]` transcript segment.
|
|
91
|
+
*/
|
|
92
|
+
export class SpeakerAttributionTimeline {
|
|
93
|
+
diarizer;
|
|
94
|
+
roster = [];
|
|
95
|
+
localUserId = 'local';
|
|
96
|
+
localUserName = 'You';
|
|
97
|
+
currentSpeakerId = '';
|
|
98
|
+
currentSpeakerName = '';
|
|
99
|
+
lastVisualUpdateMs = 0;
|
|
100
|
+
speakerSpans = [];
|
|
101
|
+
audioHistory = [];
|
|
102
|
+
speakerMap = new Map();
|
|
103
|
+
uiLagCompensationSeconds = 0.25;
|
|
104
|
+
constructor(diarizer) {
|
|
105
|
+
this.diarizer = diarizer;
|
|
106
|
+
}
|
|
107
|
+
updateRoster(payload) {
|
|
108
|
+
this.roster = payload.participants;
|
|
109
|
+
if (payload.localUserId)
|
|
110
|
+
this.localUserId = payload.localUserId;
|
|
111
|
+
if (payload.localUserName)
|
|
112
|
+
this.localUserName = payload.localUserName;
|
|
113
|
+
}
|
|
114
|
+
recordSpeakerActivity(payload) {
|
|
115
|
+
const adjustedStart = Math.max(0, payload.t - this.uiLagCompensationSeconds);
|
|
116
|
+
const adjustedEnd = Math.max(adjustedStart + 0.35, payload.t + 0.35);
|
|
117
|
+
const last = this.speakerSpans[this.speakerSpans.length - 1];
|
|
118
|
+
if (last &&
|
|
119
|
+
last.participantId === payload.participantId &&
|
|
120
|
+
adjustedStart - last.t1 <= 1.5) {
|
|
121
|
+
last.t1 = Math.max(last.t1, adjustedEnd);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
if (last && last.t1 > adjustedStart) {
|
|
125
|
+
last.t1 = Math.max(last.t0, adjustedStart);
|
|
126
|
+
}
|
|
127
|
+
this.speakerSpans.push({
|
|
128
|
+
participantId: payload.participantId,
|
|
129
|
+
name: payload.name,
|
|
130
|
+
t0: adjustedStart,
|
|
131
|
+
t1: adjustedEnd,
|
|
132
|
+
source: payload.source,
|
|
133
|
+
});
|
|
134
|
+
if (this.speakerSpans.length > 600) {
|
|
135
|
+
this.speakerSpans.splice(0, this.speakerSpans.length - 600);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
this.currentSpeakerId = payload.participantId;
|
|
139
|
+
this.currentSpeakerName = payload.name;
|
|
140
|
+
this.lastVisualUpdateMs = Date.now();
|
|
141
|
+
}
|
|
142
|
+
recordAudioChunk(chunk) {
|
|
143
|
+
this.audioHistory.push({
|
|
144
|
+
t0: chunk.t0,
|
|
145
|
+
t1: chunk.t1,
|
|
146
|
+
sysRMS: chunk.sysRMS,
|
|
147
|
+
micRMS: chunk.micRMS,
|
|
148
|
+
micActive: chunk.micActive,
|
|
149
|
+
});
|
|
150
|
+
if (this.audioHistory.length > 1200) {
|
|
151
|
+
this.audioHistory.splice(0, this.audioHistory.length - 1200);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
hasSpeechEnergy(t0, t1) {
|
|
155
|
+
if (this.audioHistory.length === 0)
|
|
156
|
+
return true;
|
|
157
|
+
const slice = this.audioHistory.filter((a) => a.t1 >= t0 - 0.15 && a.t0 <= t1 + 0.15);
|
|
158
|
+
if (slice.length === 0)
|
|
159
|
+
return true;
|
|
160
|
+
let peakSys = 0;
|
|
161
|
+
let peakMic = 0;
|
|
162
|
+
for (const s of slice) {
|
|
163
|
+
if (s.sysRMS > peakSys)
|
|
164
|
+
peakSys = s.sysRMS;
|
|
165
|
+
if (s.micRMS > peakMic)
|
|
166
|
+
peakMic = s.micRMS;
|
|
167
|
+
if (s.micActive)
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
return peakSys >= 0.003 || peakMic >= 0.008;
|
|
171
|
+
}
|
|
172
|
+
energyStats(t0, t1) {
|
|
173
|
+
const slice = this.audioHistory.filter((a) => a.t1 >= t0 - 0.15 && a.t0 <= t1 + 0.15);
|
|
174
|
+
if (slice.length === 0) {
|
|
175
|
+
return { micActive: false, meanSys: 0, meanMic: 0 };
|
|
176
|
+
}
|
|
177
|
+
let sumSys = 0;
|
|
178
|
+
let sumMic = 0;
|
|
179
|
+
let activeCount = 0;
|
|
180
|
+
for (const item of slice) {
|
|
181
|
+
sumSys += item.sysRMS;
|
|
182
|
+
sumMic += item.micRMS;
|
|
183
|
+
if (item.micActive || item.micRMS > 0.022)
|
|
184
|
+
activeCount++;
|
|
185
|
+
}
|
|
186
|
+
const meanSys = sumSys / slice.length;
|
|
187
|
+
const meanMic = sumMic / slice.length;
|
|
188
|
+
const ratio = activeCount / slice.length;
|
|
189
|
+
return {
|
|
190
|
+
micActive: ratio >= 0.35 || meanMic > 0.022,
|
|
191
|
+
meanSys,
|
|
192
|
+
meanMic,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
bestVisualSpeaker(t0, t1) {
|
|
196
|
+
if (this.speakerSpans.length === 0)
|
|
197
|
+
return null;
|
|
198
|
+
const queryStart = Math.max(0, t0 - 0.35);
|
|
199
|
+
const queryEnd = Math.max(queryStart + 0.1, t1 + 0.35);
|
|
200
|
+
const scoresById = new Map();
|
|
201
|
+
for (const span of this.speakerSpans) {
|
|
202
|
+
const overlap = Math.min(queryEnd, span.t1) - Math.max(queryStart, span.t0);
|
|
203
|
+
if (overlap > 0) {
|
|
204
|
+
const weight = span.source === 'chrome_ext' || span.source === 'native_ax' ? 1.2 : 1.0;
|
|
205
|
+
const prev = scoresById.get(span.participantId)?.score ?? 0;
|
|
206
|
+
scoresById.set(span.participantId, {
|
|
207
|
+
score: prev + overlap * weight,
|
|
208
|
+
name: span.name,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
let bestId = '';
|
|
213
|
+
let bestScore = -1;
|
|
214
|
+
let bestName = '';
|
|
215
|
+
for (const [id, entry] of scoresById.entries()) {
|
|
216
|
+
if (entry.score > bestScore) {
|
|
217
|
+
bestScore = entry.score;
|
|
218
|
+
bestId = id;
|
|
219
|
+
bestName = entry.name;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (!bestId)
|
|
223
|
+
return null;
|
|
224
|
+
const resolvedName = this.roster.find((p) => p.id === bestId)?.name ?? bestName;
|
|
225
|
+
return { id: bestId, name: resolvedName };
|
|
226
|
+
}
|
|
227
|
+
applyDiarizationSegments(segments, currentAudioSeconds) {
|
|
228
|
+
const unknown = this.roster.length === 2 ? this.roster.find((p) => p.id !== this.localUserId) : undefined;
|
|
229
|
+
const unknownId = unknown?.id ?? '';
|
|
230
|
+
const emitted = [];
|
|
231
|
+
for (const seg of segments) {
|
|
232
|
+
const key = seg.speakerId;
|
|
233
|
+
if (!this.speakerMap.has(key)) {
|
|
234
|
+
const spanMatch = this.bestVisualSpeaker(seg.t0, seg.t1);
|
|
235
|
+
if (spanMatch) {
|
|
236
|
+
this.speakerMap.set(key, spanMatch.id);
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
const stats = this.energyStats(seg.t0, seg.t1);
|
|
240
|
+
const values = Array.from(this.speakerMap.values());
|
|
241
|
+
if (stats.micActive &&
|
|
242
|
+
(stats.meanSys < 0.012 || stats.meanMic > stats.meanSys * 1.8) &&
|
|
243
|
+
this.localUserId &&
|
|
244
|
+
!values.includes(this.localUserId)) {
|
|
245
|
+
this.speakerMap.set(key, this.localUserId);
|
|
246
|
+
}
|
|
247
|
+
else if (!stats.micActive && unknownId) {
|
|
248
|
+
this.speakerMap.set(key, unknownId);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
const mappedId = this.speakerMap.get(key);
|
|
253
|
+
if (mappedId) {
|
|
254
|
+
const mappedName = this.roster.find((p) => p.id === mappedId)?.name ??
|
|
255
|
+
(mappedId === this.localUserId ? this.localUserName : mappedId);
|
|
256
|
+
const hasVisualSpans = this.speakerSpans.some((s) => s.source === 'native_ax' || s.source === 'chrome_ext');
|
|
257
|
+
if (!hasVisualSpans || seg.t1 >= currentAudioSeconds - 2.5) {
|
|
258
|
+
emitted.push({ participantId: mappedId, name: mappedName, t: seg.t0 });
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return emitted;
|
|
263
|
+
}
|
|
264
|
+
speakerAt(t0, t1) {
|
|
265
|
+
const stats = this.energyStats(t0, t1);
|
|
266
|
+
// 1. Local mic clearly active while system audio is silent
|
|
267
|
+
if (stats.micActive && stats.meanSys < 0.01 && this.localUserId) {
|
|
268
|
+
const name = this.roster.find((p) => p.id === this.localUserId)?.name ?? this.localUserName;
|
|
269
|
+
return { id: this.localUserId, name };
|
|
270
|
+
}
|
|
271
|
+
// 2. Maximum overlap with visual/UI speaker spans
|
|
272
|
+
const visual = this.bestVisualSpeaker(t0, t1);
|
|
273
|
+
if (visual)
|
|
274
|
+
return visual;
|
|
275
|
+
// 3. Local mic dominant over system audio bleed
|
|
276
|
+
if (stats.micActive &&
|
|
277
|
+
(stats.meanSys < 0.015 || stats.meanMic > stats.meanSys * 1.8) &&
|
|
278
|
+
this.localUserId) {
|
|
279
|
+
const name = this.roster.find((p) => p.id === this.localUserId)?.name ?? this.localUserName;
|
|
280
|
+
return { id: this.localUserId, name };
|
|
281
|
+
}
|
|
282
|
+
// 4. IncrementalDiarizer cluster at midpoint
|
|
283
|
+
const mid = (t0 + t1) * 0.5;
|
|
284
|
+
if (this.diarizer) {
|
|
285
|
+
const sid = this.diarizer.speakerAt(mid);
|
|
286
|
+
if (sid) {
|
|
287
|
+
const mapped = this.speakerMap.get(sid);
|
|
288
|
+
if (mapped) {
|
|
289
|
+
const name = this.roster.find((p) => p.id === mapped)?.name ??
|
|
290
|
+
(mapped === this.localUserId ? this.localUserName : mapped);
|
|
291
|
+
return { id: mapped, name };
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
// 5. 2-person call fallback when local mic is silent
|
|
296
|
+
if (!stats.micActive && this.roster.length <= 2) {
|
|
297
|
+
const remote = this.roster.find((p) => p.id !== this.localUserId);
|
|
298
|
+
if (remote)
|
|
299
|
+
return { id: remote.id, name: remote.name };
|
|
300
|
+
}
|
|
301
|
+
// 6. Recent visual speaker within 3s
|
|
302
|
+
if (this.currentSpeakerId && Date.now() - this.lastVisualUpdateMs < 3000) {
|
|
303
|
+
return { id: this.currentSpeakerId, name: this.currentSpeakerName };
|
|
304
|
+
}
|
|
305
|
+
return { id: '', name: '' };
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Connects live `NativeCaptureBridge` events (audio, roster, speaker spans) to any
|
|
310
|
+
* pluggable `STTProvider` (streaming WebSocket OR batch HTTP/callback) and optional `DiarizationProvider`.
|
|
311
|
+
*/
|
|
312
|
+
export class MeetingSessionPipeline {
|
|
313
|
+
opts;
|
|
314
|
+
timeline;
|
|
315
|
+
diarizer;
|
|
316
|
+
sttStream;
|
|
317
|
+
closed = false;
|
|
318
|
+
// Streaming STT cumulative state
|
|
319
|
+
lastConfirmedText = '';
|
|
320
|
+
lastConfirmedEnd = 0;
|
|
321
|
+
lastPartialText = '';
|
|
322
|
+
lastPartialT0 = 0;
|
|
323
|
+
lastPartialT1 = 0;
|
|
324
|
+
// Batch VAD STT rolling state
|
|
325
|
+
batchPcmChunks = [];
|
|
326
|
+
batchPcmBytes = 0;
|
|
327
|
+
batchStartT0 = 0;
|
|
328
|
+
batchLatestT1 = 0;
|
|
329
|
+
batchHasSpeech = false;
|
|
330
|
+
batchSilenceDuration = 0;
|
|
331
|
+
batchInFlight = Promise.resolve();
|
|
332
|
+
// Diarization rolling window state
|
|
333
|
+
diarizePcmBuffer = Buffer.alloc(0);
|
|
334
|
+
diarizeWindowStart = 0;
|
|
335
|
+
diarizeTimer = null;
|
|
336
|
+
diarizeBusy = false;
|
|
337
|
+
currentAudioSeconds = 0;
|
|
338
|
+
constructor(opts) {
|
|
339
|
+
this.opts = opts;
|
|
340
|
+
if (opts.diarize) {
|
|
341
|
+
this.diarizer = new IncrementalDiarizer(8, 3);
|
|
342
|
+
}
|
|
343
|
+
this.timeline = new SpeakerAttributionTimeline(this.diarizer);
|
|
344
|
+
}
|
|
345
|
+
async start() {
|
|
346
|
+
if (this.opts.stt?.startStream) {
|
|
347
|
+
const stream = this.opts.stt.startStream(this.opts.transcribeOptions);
|
|
348
|
+
if (stream) {
|
|
349
|
+
this.sttStream = stream;
|
|
350
|
+
await stream.ready();
|
|
351
|
+
void this.consumeSTTStream(stream);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
if (this.opts.diarize && this.diarizer) {
|
|
355
|
+
const diarizeProvider = this.opts.diarize;
|
|
356
|
+
const diarizer = this.diarizer;
|
|
357
|
+
this.diarizeTimer = setInterval(() => {
|
|
358
|
+
if (this.closed || this.diarizeBusy)
|
|
359
|
+
return;
|
|
360
|
+
const sampleRate = 16000;
|
|
361
|
+
const minBytes = sampleRate * 2 * 3; // 3s minimum
|
|
362
|
+
const windowBytes = sampleRate * 2 * 8; // 8s window
|
|
363
|
+
const hopBytes = sampleRate * 2 * 3; // 3s hop
|
|
364
|
+
if (this.diarizePcmBuffer.length < minBytes)
|
|
365
|
+
return;
|
|
366
|
+
const tStart = this.diarizeWindowStart;
|
|
367
|
+
const windowBuf = Buffer.from(this.diarizePcmBuffer.subarray(0, Math.min(windowBytes, this.diarizePcmBuffer.length)));
|
|
368
|
+
if (this.diarizePcmBuffer.length >= windowBytes) {
|
|
369
|
+
this.diarizePcmBuffer = this.diarizePcmBuffer.subarray(hopBytes);
|
|
370
|
+
this.diarizeWindowStart += 3;
|
|
371
|
+
}
|
|
372
|
+
this.diarizeBusy = true;
|
|
373
|
+
diarizer
|
|
374
|
+
.process(diarizeProvider, windowBuf, tStart)
|
|
375
|
+
.then((segs) => {
|
|
376
|
+
if (this.closed)
|
|
377
|
+
return;
|
|
378
|
+
const changes = this.timeline.applyDiarizationSegments(segs, this.currentAudioSeconds);
|
|
379
|
+
for (const c of changes) {
|
|
380
|
+
this.opts.onEvent({
|
|
381
|
+
type: 'speaker_change',
|
|
382
|
+
participantId: c.participantId,
|
|
383
|
+
name: c.name,
|
|
384
|
+
t: c.t,
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
})
|
|
388
|
+
.catch((err) => {
|
|
389
|
+
if (!this.closed) {
|
|
390
|
+
this.opts.onEvent({
|
|
391
|
+
type: 'warning',
|
|
392
|
+
reason: 'diarize_error',
|
|
393
|
+
message: err instanceof Error ? err.message : String(err),
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
})
|
|
397
|
+
.finally(() => {
|
|
398
|
+
this.diarizeBusy = false;
|
|
399
|
+
});
|
|
400
|
+
}, 1500);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
handleRoster(payload) {
|
|
404
|
+
if (this.closed)
|
|
405
|
+
return;
|
|
406
|
+
this.timeline.updateRoster(payload);
|
|
407
|
+
this.opts.onEvent({ type: 'roster', participants: payload.participants });
|
|
408
|
+
}
|
|
409
|
+
handleSpeakerActivity(payload) {
|
|
410
|
+
if (this.closed)
|
|
411
|
+
return;
|
|
412
|
+
this.timeline.recordSpeakerActivity(payload);
|
|
413
|
+
}
|
|
414
|
+
handleSpeakerChange(payload) {
|
|
415
|
+
if (this.closed)
|
|
416
|
+
return;
|
|
417
|
+
this.timeline.recordSpeakerActivity(payload);
|
|
418
|
+
this.opts.onEvent({
|
|
419
|
+
type: 'speaker_change',
|
|
420
|
+
participantId: payload.participantId,
|
|
421
|
+
name: payload.name,
|
|
422
|
+
t: payload.t,
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
handleAudio(chunk) {
|
|
426
|
+
if (this.closed)
|
|
427
|
+
return;
|
|
428
|
+
this.currentAudioSeconds = chunk.t1;
|
|
429
|
+
this.timeline.recordAudioChunk(chunk);
|
|
430
|
+
if (this.opts.diarize) {
|
|
431
|
+
this.diarizePcmBuffer = Buffer.concat([this.diarizePcmBuffer, chunk.pcm]);
|
|
432
|
+
}
|
|
433
|
+
if (this.sttStream) {
|
|
434
|
+
this.sttStream.feed(chunk.pcm);
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
// Batch / HTTP STT path: accumulate speech chunks and flush on pause or max chunk duration
|
|
438
|
+
if (this.opts.stt?.transcribe) {
|
|
439
|
+
const chunkDur = Math.max(0.05, chunk.t1 - chunk.t0);
|
|
440
|
+
const isSpeech = chunk.sysRMS >= 0.004 || chunk.micRMS >= 0.008 || chunk.micActive;
|
|
441
|
+
if (this.batchPcmBytes === 0) {
|
|
442
|
+
if (!isSpeech)
|
|
443
|
+
return; // Don't start a batch chunk during pure silence
|
|
444
|
+
this.batchStartT0 = chunk.t0;
|
|
445
|
+
}
|
|
446
|
+
this.batchPcmChunks.push(chunk.pcm);
|
|
447
|
+
this.batchPcmBytes += chunk.pcm.length;
|
|
448
|
+
this.batchLatestT1 = chunk.t1;
|
|
449
|
+
if (isSpeech) {
|
|
450
|
+
this.batchHasSpeech = true;
|
|
451
|
+
this.batchSilenceDuration = 0;
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
this.batchSilenceDuration += chunkDur;
|
|
455
|
+
}
|
|
456
|
+
const bufferedSeconds = this.batchPcmBytes / (16000 * 2);
|
|
457
|
+
const maxChunkSec = this.opts.batchChunkSeconds ?? 3.5;
|
|
458
|
+
const pauseFlush = bufferedSeconds >= 1.0 && this.batchSilenceDuration >= 0.55;
|
|
459
|
+
if (bufferedSeconds >= maxChunkSec || pauseFlush) {
|
|
460
|
+
this.flushBatchSTTChunk();
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
flushBatchSTTChunk() {
|
|
465
|
+
if (!this.opts.stt?.transcribe || this.batchPcmBytes === 0 || !this.batchHasSpeech) {
|
|
466
|
+
this.batchPcmChunks = [];
|
|
467
|
+
this.batchPcmBytes = 0;
|
|
468
|
+
this.batchHasSpeech = false;
|
|
469
|
+
this.batchSilenceDuration = 0;
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
const pcm = Buffer.concat(this.batchPcmChunks);
|
|
473
|
+
const sliceT0 = this.batchStartT0;
|
|
474
|
+
const sliceT1 = this.batchLatestT1;
|
|
475
|
+
this.batchPcmChunks = [];
|
|
476
|
+
this.batchPcmBytes = 0;
|
|
477
|
+
this.batchHasSpeech = false;
|
|
478
|
+
this.batchSilenceDuration = 0;
|
|
479
|
+
const stt = this.opts.stt;
|
|
480
|
+
const wav = encodeWavFromInt16PCM(pcm, 16000);
|
|
481
|
+
this.batchInFlight = this.batchInFlight
|
|
482
|
+
.then(async () => {
|
|
483
|
+
const res = await stt.transcribe(wav, this.opts.transcribeOptions);
|
|
484
|
+
const segs = res.segments && res.segments.length > 0
|
|
485
|
+
? res.segments
|
|
486
|
+
: res.text.trim()
|
|
487
|
+
? [{ id: 0, start: 0, end: sliceT1 - sliceT0, text: res.text.trim() }]
|
|
488
|
+
: [];
|
|
489
|
+
for (const s of segs) {
|
|
490
|
+
const clean = s.text.trim();
|
|
491
|
+
if (!clean || isPlaceholderText(clean))
|
|
492
|
+
continue;
|
|
493
|
+
const t0 = sliceT0 + Math.max(0, s.start);
|
|
494
|
+
const t1 = Math.max(t0 + 0.2, sliceT0 + s.end);
|
|
495
|
+
if (!this.timeline.hasSpeechEnergy(t0, t1))
|
|
496
|
+
continue;
|
|
497
|
+
const spk = this.timeline.speakerAt(t0, t1);
|
|
498
|
+
this.opts.onEvent({
|
|
499
|
+
type: 'transcript',
|
|
500
|
+
participantId: spk.id,
|
|
501
|
+
name: spk.name,
|
|
502
|
+
text: clean,
|
|
503
|
+
t0,
|
|
504
|
+
t1,
|
|
505
|
+
partial: false,
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
})
|
|
509
|
+
.catch((err) => {
|
|
510
|
+
if (!this.closed) {
|
|
511
|
+
this.opts.onEvent({
|
|
512
|
+
type: 'warning',
|
|
513
|
+
reason: 'stt_error',
|
|
514
|
+
message: err instanceof Error ? err.message : String(err),
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
async consumeSTTStream(stream) {
|
|
520
|
+
try {
|
|
521
|
+
for await (const frame of stream.frames) {
|
|
522
|
+
if (this.closed)
|
|
523
|
+
break;
|
|
524
|
+
if (frame.type === 'error') {
|
|
525
|
+
this.opts.onEvent({ type: 'error', message: frame.text });
|
|
526
|
+
continue;
|
|
527
|
+
}
|
|
528
|
+
const text = frame.text.trim();
|
|
529
|
+
if (!text || isPlaceholderText(text))
|
|
530
|
+
continue;
|
|
531
|
+
if (frame.type === 'final') {
|
|
532
|
+
// Extract newly confirmed suffix relative to previous cumulative confirmed text
|
|
533
|
+
let delta = text;
|
|
534
|
+
if (this.lastConfirmedText && text.startsWith(this.lastConfirmedText)) {
|
|
535
|
+
delta = text.slice(this.lastConfirmedText.length).trim();
|
|
536
|
+
}
|
|
537
|
+
const prevEnd = this.lastConfirmedEnd;
|
|
538
|
+
this.lastConfirmedText = text;
|
|
539
|
+
const t0 = frame.t0 > 0 ? frame.t0 : prevEnd;
|
|
540
|
+
const t1 = Math.max(t0 + 0.2, frame.t1 > 0 ? frame.t1 : this.currentAudioSeconds);
|
|
541
|
+
this.lastConfirmedEnd = t1;
|
|
542
|
+
this.lastPartialText = '';
|
|
543
|
+
if (!delta || !this.timeline.hasSpeechEnergy(t0, t1))
|
|
544
|
+
continue;
|
|
545
|
+
const spk = this.timeline.speakerAt(t0, t1);
|
|
546
|
+
this.opts.onEvent({
|
|
547
|
+
type: 'transcript',
|
|
548
|
+
participantId: spk.id,
|
|
549
|
+
name: spk.name,
|
|
550
|
+
text: delta,
|
|
551
|
+
t0,
|
|
552
|
+
t1,
|
|
553
|
+
partial: false,
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
else if (frame.type === 'partial') {
|
|
557
|
+
const t0 = frame.t0 >= 0 ? frame.t0 : this.lastConfirmedEnd;
|
|
558
|
+
const t1 = Math.max(t0 + 0.2, frame.t1 > 0 ? frame.t1 : this.currentAudioSeconds);
|
|
559
|
+
if (!this.timeline.hasSpeechEnergy(t0, t1))
|
|
560
|
+
continue;
|
|
561
|
+
this.lastPartialText = text;
|
|
562
|
+
this.lastPartialT0 = t0;
|
|
563
|
+
this.lastPartialT1 = t1;
|
|
564
|
+
const spk = this.timeline.speakerAt(t0, t1);
|
|
565
|
+
this.opts.onEvent({
|
|
566
|
+
type: 'transcript',
|
|
567
|
+
participantId: spk.id,
|
|
568
|
+
name: spk.name,
|
|
569
|
+
text,
|
|
570
|
+
t0,
|
|
571
|
+
t1,
|
|
572
|
+
partial: true,
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
catch (err) {
|
|
578
|
+
if (!this.closed) {
|
|
579
|
+
this.opts.onEvent({
|
|
580
|
+
type: 'error',
|
|
581
|
+
message: err instanceof Error ? err.message : String(err),
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
async stop() {
|
|
587
|
+
if (this.closed)
|
|
588
|
+
return;
|
|
589
|
+
if (this.diarizeTimer) {
|
|
590
|
+
clearInterval(this.diarizeTimer);
|
|
591
|
+
this.diarizeTimer = null;
|
|
592
|
+
}
|
|
593
|
+
if (this.sttStream) {
|
|
594
|
+
await this.sttStream.close();
|
|
595
|
+
this.sttStream = undefined;
|
|
596
|
+
// If any unconfirmed partial remained on close, flush it as final
|
|
597
|
+
if (this.lastPartialText && !isPlaceholderText(this.lastPartialText)) {
|
|
598
|
+
const t0 = this.lastPartialT0;
|
|
599
|
+
const t1 = Math.max(t0 + 0.2, this.lastPartialT1);
|
|
600
|
+
if (this.timeline.hasSpeechEnergy(t0, t1)) {
|
|
601
|
+
const spk = this.timeline.speakerAt(t0, t1);
|
|
602
|
+
this.opts.onEvent({
|
|
603
|
+
type: 'transcript',
|
|
604
|
+
participantId: spk.id,
|
|
605
|
+
name: spk.name,
|
|
606
|
+
text: this.lastPartialText,
|
|
607
|
+
t0,
|
|
608
|
+
t1,
|
|
609
|
+
partial: false,
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
this.lastPartialText = '';
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
else if (this.opts.stt?.transcribe) {
|
|
616
|
+
this.flushBatchSTTChunk();
|
|
617
|
+
await this.batchInFlight;
|
|
618
|
+
}
|
|
619
|
+
this.closed = true;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
function isPlaceholderText(text) {
|
|
623
|
+
const lower = text.toLowerCase();
|
|
624
|
+
return lower === 'waiting for speech...' || lower === 'waiting for speech';
|
|
625
|
+
}
|
|
626
|
+
//# sourceMappingURL=attribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.js","sourceRoot":"","sources":["../src/attribution.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,qBAAqB,GAItB,MAAM,gBAAgB,CAAA;AAiBvB;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IAMZ;IACA;IANV,YAAY,GAAG,CAAC,CAAA;IAChB,SAAS,GAAmD,EAAE,CAAA;IAC9D,gBAAgB,GAAG,CAAC,CAAA;IAE5B,YACkB,gBAAgB,CAAC,EACjB,aAAa,CAAC;QADd,kBAAa,GAAb,aAAa,CAAI;QACjB,eAAU,GAAV,UAAU,CAAI;IAC7B,CAAC;IAEJ,KAAK,CAAC,OAAO,CACX,QAA6B,EAC7B,SAAiB,EACjB,WAAmB;QAEnB,MAAM,GAAG,GAAG,qBAAqB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QACnD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QAE1C,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ;aAC1B,MAAM,CAA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