Restore bot voice output with TTS mic preflight.
Run a one-time best-effort mic enable before first playback so injected TTS audio is audible even when Teams starts muted. Made-with: Cursor
This commit is contained in:
parent
3863063984
commit
abf38eada3
1 changed files with 15 additions and 0 deletions
|
|
@ -72,6 +72,7 @@ export class BotOrchestrator {
|
|||
private _isShuttingDown: boolean = false;
|
||||
private _isDebugMode: boolean = false;
|
||||
private _keepAliveInterval: NodeJS.Timeout | null = null;
|
||||
private _hasAttemptedMicEnableForTts: boolean = false;
|
||||
|
||||
constructor(
|
||||
sessionId: string,
|
||||
|
|
@ -828,6 +829,20 @@ export class BotOrchestrator {
|
|||
return;
|
||||
}
|
||||
|
||||
// Best-effort safety net:
|
||||
// In some authenticated sessions the mic can be muted after join.
|
||||
// TTS is injected into the mic stream; if mic is muted, participants hear nothing.
|
||||
// We only attempt this once per session to avoid unnecessary UI actions.
|
||||
if (!this._hasAttemptedMicEnableForTts && this._teamsActions) {
|
||||
this._hasAttemptedMicEnableForTts = true;
|
||||
try {
|
||||
const micEnabled = await this._teamsActions.toggleMic(true);
|
||||
this._logger.info(`TTS preflight mic-enable attempt result: ${micEnabled ? 'ok' : 'not-confirmed'}`);
|
||||
} catch (err) {
|
||||
this._logger.warn(`TTS preflight mic-enable attempt failed: ${err}`);
|
||||
}
|
||||
}
|
||||
|
||||
await this._audioProcedure.playAudio(audioData, format);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue