feat: enforce aggressive hybrid mode for names-only captions
Made-with: Cursor
This commit is contained in:
parent
39a422af25
commit
77aa4f3d07
1 changed files with 10 additions and 35 deletions
|
|
@ -926,14 +926,9 @@ export class BotOrchestrator {
|
||||||
this._page,
|
this._page,
|
||||||
this._logger,
|
this._logger,
|
||||||
(entry) => {
|
(entry) => {
|
||||||
const transferMode = this._getEffectiveTransferMode();
|
// Aggressive hybrid mode: captions are always speaker hints only.
|
||||||
if (transferMode === 'audio') {
|
// Caption text is never persisted as transcript due to language quality issues.
|
||||||
// In audio mode, captions are only used as speaker hints.
|
this._sendTranscript(entry.speaker, entry.text, entry.isFinal, 'speakerHint');
|
||||||
this._sendTranscript(entry.speaker, entry.text, entry.isFinal, 'speakerHint');
|
|
||||||
} else {
|
|
||||||
this._sendTranscript(entry.speaker, entry.text, entry.isFinal, 'caption');
|
|
||||||
this._callbacks.onTranscript(entry);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
this._options.language
|
this._options.language
|
||||||
);
|
);
|
||||||
|
|
@ -958,11 +953,8 @@ export class BotOrchestrator {
|
||||||
// This ensures Teams gets our controlled audio stream when it calls getUserMedia
|
// This ensures Teams gets our controlled audio stream when it calls getUserMedia
|
||||||
await this._audioProcedure.injectAudioOverride();
|
await this._audioProcedure.injectAudioOverride();
|
||||||
|
|
||||||
// Inject audio capture (WebRTC interception) if transfer mode requires it
|
// Aggressive hybrid mode: always capture meeting audio as transcript source.
|
||||||
const transferMode = this._getEffectiveTransferMode();
|
await this._audioCaptureProcedure!.injectCaptureOverride();
|
||||||
if (transferMode === 'audio') {
|
|
||||||
await this._audioCaptureProcedure!.injectCaptureOverride();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle page errors
|
// Handle page errors
|
||||||
this._page.on('pageerror', (error) => {
|
this._page.on('pageerror', (error) => {
|
||||||
|
|
@ -1108,32 +1100,15 @@ export class BotOrchestrator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Subscribe to captions only as speaker hints (without enabling captions flow).
|
|
||||||
* This supports hybrid mode: audio text + caption-based speaker names.
|
|
||||||
*/
|
|
||||||
private async _enableSpeakerHintsFromCaptions(): Promise<void> {
|
|
||||||
try {
|
|
||||||
await this._captionsProcedure!.subscribeToCaptions();
|
|
||||||
this._logger.info('Speaker hints from captions subscribed (audio mode)');
|
|
||||||
} catch (error) {
|
|
||||||
this._logger.warn('Could not subscribe to captions for speaker hints:', error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable transcript capture (captions or audio) based on transfer mode.
|
* Enable transcript capture (captions or audio) based on transfer mode.
|
||||||
*/
|
*/
|
||||||
private async _enableTranscriptCapture(): Promise<void> {
|
private async _enableTranscriptCapture(): Promise<void> {
|
||||||
const transferMode = this._getEffectiveTransferMode();
|
this._logger.info(
|
||||||
this._logger.info(`Transfer mode: ${transferMode} (configured: ${this._options.transferMode || 'auto'})`);
|
`Aggressive hybrid mode active: audio STT + background captions for speaker hints (configured transferMode: ${this._options.transferMode || 'auto'})`,
|
||||||
|
);
|
||||||
if (transferMode === 'caption') {
|
await this._enableAudioCapture();
|
||||||
await this._enableCaptions();
|
await this._enableCaptions();
|
||||||
} else {
|
|
||||||
await this._enableAudioCapture();
|
|
||||||
await this._enableSpeakerHintsFromCaptions();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue