Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(transcription): add diarize flag advertised as a participant property (#17614)

bgrozevd0afbf4ef43c
diff --git a/config.js b/config.js
index b8310c297d..64c1dcb81a 100644
--- a/config.js
+++ b/config.js
@@ -547,7 +547,16 @@ var config = {
//
// // When the backend provides diarization by setting a "speaker" field, append [Speaker N] for transcription
// // events from non-0 speakers.
- // renderTranscriptDetails: false
+ // renderTranscriptDetails: false,
+ //
+ // // Requests that the transcriber diarize (split by speaker) this participant's own audio, i.e. label
+ // // segments as coming from different speakers. Enable it only for endpoints that genuinely carry
+ // // multiple speakers on a single audio stream (conference-room systems, dial-in/PSTN legs); on a
+ // // normal single-person stream a diarizer can spuriously split one talker into several speakers.
+ // // The flag is advertised to jicofo in MUC presence and takes effect only at join time (it must be
+ // // set before joining, e.g. via this config or the #config.transcription.diarize=true URL override;
+ // // toggling it mid-call has no effect). Defaults to false.
+ // diarize: false
// },
diff --git a/react/features/base/conference/functions.ts b/react/features/base/conference/functions.ts
index 849c20ad0f..1ac2a12a69 100644
--- a/react/features/base/conference/functions.ts
+++ b/react/features/base/conference/functions.ts
@@ -34,6 +34,12 @@ import {
import logger from './logger';
import { IJitsiConference } from './reducer';
+/**
+ * The local participant property used to advertise to jicofo that this
+ * participant's audio should be diarized by the transcriber.
+ */
+const P_NAME_DIARIZE = 'diarize';
+
/**
* Returns root conference state.
*
@@ -565,6 +571,16 @@ export function sendLocalParticipant(
conference?.setLocalParticipantProperty('features_screen-sharing', true);
}
+ // Advertise to jicofo that this participant's audio should be diarized by the transcriber.
+ // Only published when explicitly enabled, to keep presence clean.
+ // NOTE: this must be published here, before conference.join(), so it is part of the initial
+ // presence. jicofo allocates the colibri2 endpoint from the join presence and reads this flag
+ // only at allocation time (the endpoint create path, in both jicofo and the bridge). A value
+ // set after join would be ignored, so do not move this to a lazy/runtime toggle.
+ if (toState(stateful)['features/base/config'].transcription?.diarize === true) {
+ conference?.setLocalParticipantProperty(P_NAME_DIARIZE, true);
+ }
+
conference?.setDisplayName(name);
}
diff --git a/react/features/base/config/configType.ts b/react/features/base/config/configType.ts
index 2e06c8042e..c6fd288774 100644
--- a/react/features/base/config/configType.ts
+++ b/react/features/base/config/configType.ts
@@ -747,6 +747,17 @@ export interface IConfig {
autoCaptionOnTranscribe?: boolean;
autoTranscribeOnRecord?: boolean;
customLanguages?: object;
+
+ /**
+ * When true, advertises (via a MUC presence participant property) that this participant's audio
+ * should be diarized by the transcriber. Intended for endpoints carrying multiple speakers, e.g.
+ * conference-room systems or dial-in.
+ *
+ * Takes effect only at join time: the flag is included in the initial presence and read by jicofo
+ * when it allocates the colibri endpoint. It must be set before joining (e.g. via config or the
+ * `#config.transcription.diarize=true` URL override); toggling it during a call has no effect.
+ */
+ diarize?: boolean;
disableClosedCaptions?: boolean;
enabled?: boolean;
preferredLanguage?: string;