dsh-live-voice 0.5.1 → 0.5.2

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/lib/server.js CHANGED
@@ -90,6 +90,8 @@ var defaultSettings = Object.freeze({
90
90
  sharedVoiceCommandsEnabled: true,
91
91
  timestampsEnabled: false,
92
92
  sharedTimestampsEnabled: false,
93
+ microphoneSourceName: "Me",
94
+ sharedSourceName: "Them",
93
95
  voiceCommandSend: "send, send message",
94
96
  voiceCommandQueue: "queue, queue message",
95
97
  voiceCommandEnd: "end, end conversation",
@@ -101,8 +103,15 @@ var defaultSettings = Object.freeze({
101
103
  outputCodeMaxLines: 5,
102
104
  outputCodeNotice: resolveCodeNotice(void 0, "pt-BR"),
103
105
  rate: 1,
106
+ volume: 1,
104
107
  segmentGapMs: 400
105
108
  });
109
+ var normalizeSourceName = (value, fallback) => {
110
+ if (typeof value !== "string" || /[\u0000-\u001f\u007f-\u009f\u2028\u2029]/u.test(value))
111
+ return fallback;
112
+ const name2 = value.trim();
113
+ return name2 && name2.length <= 80 ? name2 : fallback;
114
+ };
106
115
  var normalizeCommandPhrases = (value, fallback) => typeof value === "string" && value.length <= 1e3 && !value.includes("\0") ? value.split(/[,\r\n]+/).map((phrase) => phrase.trim()).filter(Boolean).slice(0, 20).join(", ") : fallback;
107
116
  var customSilenceMinMs = 100;
108
117
  var customSilenceMaxMs = 1e4;
@@ -137,6 +146,14 @@ function normalizeSettings(value) {
137
146
  recognitionFilterEnabled: typeof source.recognitionFilterEnabled === "boolean" ? source.recognitionFilterEnabled : defaultSettings.recognitionFilterEnabled,
138
147
  recognitionMinimumWords: Number.isInteger(source.recognitionMinimumWords) && source.recognitionMinimumWords >= 1 && source.recognitionMinimumWords <= 20 ? source.recognitionMinimumWords : defaultSettings.recognitionMinimumWords,
139
148
  voiceCommandsEnabled: typeof source.voiceCommandsEnabled === "boolean" ? source.voiceCommandsEnabled : defaultSettings.voiceCommandsEnabled,
149
+ microphoneSourceName: normalizeSourceName(
150
+ source.microphoneSourceName,
151
+ defaultSettings.microphoneSourceName
152
+ ),
153
+ sharedSourceName: normalizeSourceName(
154
+ source.sharedSourceName,
155
+ defaultSettings.sharedSourceName
156
+ ),
140
157
  timestampsEnabled: typeof source.timestampsEnabled === "boolean" ? source.timestampsEnabled : false,
141
158
  sharedTimestampsEnabled: typeof source.sharedTimestampsEnabled === "boolean" ? source.sharedTimestampsEnabled : false,
142
159
  sharedVoiceCommandsEnabled: typeof source.sharedVoiceCommandsEnabled === "boolean" ? source.sharedVoiceCommandsEnabled : typeof source.voiceCommandsEnabled === "boolean" ? source.voiceCommandsEnabled : defaultSettings.sharedVoiceCommandsEnabled,
@@ -172,6 +189,7 @@ function normalizeSettings(value) {
172
189
  outputCodeMaxLines: Number.isInteger(source.outputCodeMaxLines) && source.outputCodeMaxLines >= 0 && source.outputCodeMaxLines <= 100 ? source.outputCodeMaxLines : defaultSettings.outputCodeMaxLines,
173
190
  outputCodeNotice: typeof source.outputCodeNotice === "string" && source.outputCodeNotice.trim() && source.outputCodeNotice.length <= 300 && !source.outputCodeNotice.includes("\0") ? resolveCodeNotice(source.outputCodeNotice, source.lang || defaultSettings.lang) : resolveCodeNotice(defaultSettings.outputCodeNotice, source.lang || defaultSettings.lang),
174
191
  rate: Number.isFinite(source.rate) && source.rate >= 0.1 && source.rate <= 3 ? source.rate : 1,
192
+ volume: Number.isFinite(source.volume) && source.volume >= 0 && source.volume <= 1 ? source.volume : 1,
175
193
  segmentGapMs: Number.isFinite(source.segmentGapMs) && source.segmentGapMs >= 0 && source.segmentGapMs <= 2e3 ? Math.round(source.segmentGapMs) : 400
176
194
  };
177
195
  }
@@ -995,7 +1013,7 @@ var VAD_ASSET_TYPES = {
995
1013
  };
996
1014
  var MAX_VAD_ASSET_BYTES = 32 * 1024 * 1024;
997
1015
  function registerVadAssetRoutes(ctx, options = {}) {
998
- const version = options.version ?? (true ? "0.5.1" : "test");
1016
+ const version = options.version ?? (true ? "0.5.2" : "test");
999
1017
  if (!/^[a-zA-Z0-9][a-zA-Z0-9.+-]{0,127}$/.test(version))
1000
1018
  throw new Error("Invalid VAD asset version");
1001
1019
  const directory = options.directory ?? fileURLToPath(new URL("./vad/", import.meta.url));
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "pluginVersion": "0.5.1",
3
+ "pluginVersion": "0.5.2",
4
4
  "dependencies": {
5
5
  "@ricky0123/vad-web": "0.0.31",
6
6
  "onnxruntime-web": "1.22.0"
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "vad.worker.js": {
43
43
  "bytes": 78352,
44
- "sha256": "5dea282120cb9d40f49e5c833985df08616ad4dd3ec9542076ae327ebcffb844"
44
+ "sha256": "8dae4cce88b03ec93fde3e3b4de3d502c0e50254497a29649a1e1b8327ca2c94"
45
45
  }
46
46
  }
47
47
  }
@@ -1632,7 +1632,7 @@ var vo = Ke;
1632
1632
  Object.defineProperty(I.versions, "web", { value: $t, enumerable: true });
1633
1633
 
1634
1634
  // src/modules/recognition/vad/assets.ts
1635
- var sileroVadAssetBase = () => "/api/dsh-live-voice/vad/" + encodeURIComponent(true ? "0.5.1" : "test") + "/";
1635
+ var sileroVadAssetBase = () => "/api/dsh-live-voice/vad/" + encodeURIComponent(true ? "0.5.2" : "test") + "/";
1636
1636
 
1637
1637
  // src/modules/recognition/vad/StreamingResampler.ts
1638
1638
  var StreamingResampler = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-live-voice",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "dshTestedVersion": "0.2.1-alpha.2",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -103,6 +103,9 @@ export interface LiveVoiceTranslation extends Translation {
103
103
  'dsh-live-voice.recognition.holdToTalk.help': string;
104
104
  'dsh-live-voice.recognition.language.automatic': string;
105
105
  'dsh-live-voice.recognition.language.label': string;
106
+ 'dsh-live-voice.recognition.language.options.chinese': string;
107
+ 'dsh-live-voice.recognition.language.options.french': string;
108
+ 'dsh-live-voice.recognition.language.options.spanish': string;
106
109
  'dsh-live-voice.recognition.manualSend.help': string;
107
110
  'dsh-live-voice.recognition.maxUtterance.help': string;
108
111
  'dsh-live-voice.recognition.maxUtterance.label': string;
@@ -196,6 +199,10 @@ export interface LiveVoiceTranslation extends Translation {
196
199
  'dsh-live-voice.settings.layout.voice': string;
197
200
  'dsh-live-voice.settings.persistence.loadError': string;
198
201
  'dsh-live-voice.settings.persistence.saveError': string;
202
+ 'dsh-live-voice.settings.sourceNames.help': string;
203
+ 'dsh-live-voice.settings.sourceNames.microphone': string;
204
+ 'dsh-live-voice.settings.sourceNames.shared': string;
205
+ 'dsh-live-voice.settings.sourceNames.title': string;
199
206
  'dsh-live-voice.settings.tabs.conversation': string;
200
207
  'dsh-live-voice.settings.tabs.recognition': string;
201
208
  'dsh-live-voice.settings.tabs.speak': string;
@@ -215,6 +222,7 @@ export interface LiveVoiceTranslation extends Translation {
215
222
  'dsh-live-voice.speak.autoPlayback.remainingOther': string;
216
223
  'dsh-live-voice.speak.autoPlayback.status': string;
217
224
  'dsh-live-voice.speak.browser.automaticVoice': string;
225
+ 'dsh-live-voice.speak.browser.defaultVoice': string;
218
226
  'dsh-live-voice.speak.browser.label': string;
219
227
  'dsh-live-voice.speak.browser.name': string;
220
228
  'dsh-live-voice.speak.browser.outputHelp': string;
@@ -283,6 +291,8 @@ export interface LiveVoiceTranslation extends Translation {
283
291
  'dsh-live-voice.speak.segmentGap.label': string;
284
292
  'dsh-live-voice.speak.status.paused': string;
285
293
  'dsh-live-voice.speak.status.playing': string;
294
+ 'dsh-live-voice.speak.volume.help': string;
295
+ 'dsh-live-voice.speak.volume.label': string;
286
296
  }
287
297
 
288
298
  // Exclude Translation's open index signature from valid plugin identifiers.
@@ -124,6 +124,9 @@ const en: LiveVoiceTranslation = {
124
124
  'While a composer is open, hold Control anywhere on the page to capture speech. Release it to flush queued transcription, wait the configured send delay, queue the message, and close voice capture. Press Escape while holding to cancel.',
125
125
  'dsh-live-voice.recognition.language.automatic': 'Automatic — detect language',
126
126
  'dsh-live-voice.recognition.language.label': 'Recognition language',
127
+ 'dsh-live-voice.recognition.language.options.chinese': 'Chinese (Mandarin)',
128
+ 'dsh-live-voice.recognition.language.options.french': 'French',
129
+ 'dsh-live-voice.recognition.language.options.spanish': 'Spanish',
127
130
  'dsh-live-voice.recognition.manualSend.help':
128
131
  'Recognized text stays in the composer until you use the normal DSH Send control.',
129
132
  'dsh-live-voice.recognition.maxUtterance.help':
@@ -244,6 +247,11 @@ const en: LiveVoiceTranslation = {
244
247
  'Could not load Live Voice settings from the server. Reload to try again.',
245
248
  'dsh-live-voice.settings.persistence.saveError':
246
249
  'Could not save Live Voice settings on the server. Please try again.',
250
+ 'dsh-live-voice.settings.sourceNames.help':
251
+ 'When both sources capture, these names label new transcript blocks, not individual participants. Saved on blur; blank restores Me / Them. Maximum 80 characters. Existing text is unchanged.',
252
+ 'dsh-live-voice.settings.sourceNames.microphone': 'Microphone source name',
253
+ 'dsh-live-voice.settings.sourceNames.shared': 'Shared-audio source name',
254
+ 'dsh-live-voice.settings.sourceNames.title': 'Meeting source names',
247
255
  'dsh-live-voice.settings.tabs.conversation': 'Conversation',
248
256
  'dsh-live-voice.settings.tabs.recognition': 'Speech recognition',
249
257
  'dsh-live-voice.settings.tabs.speak': 'Speech',
@@ -269,6 +277,7 @@ const en: LiveVoiceTranslation = {
269
277
  'Automatic assistant speech: {state} — {count} speech segments remaining',
270
278
  'dsh-live-voice.speak.autoPlayback.status': 'Automatic assistant speech: {state}',
271
279
  'dsh-live-voice.speak.browser.automaticVoice': 'Automatic local voice',
280
+ 'dsh-live-voice.speak.browser.defaultVoice': 'default',
272
281
  'dsh-live-voice.speak.browser.label': 'Browser speech — device audio',
273
282
  'dsh-live-voice.speak.browser.name': 'Browser speech',
274
283
  'dsh-live-voice.speak.browser.outputHelp':
@@ -347,6 +356,9 @@ const en: LiveVoiceTranslation = {
347
356
  'dsh-live-voice.speak.segmentGap.label': 'Pause between speech segments',
348
357
  'dsh-live-voice.speak.status.paused': 'Speech paused',
349
358
  'dsh-live-voice.speak.status.playing': 'Speaking',
359
+ 'dsh-live-voice.speak.volume.help':
360
+ 'Speech playback only: 0% is silent; 100% is full volume (default). Microphone input is unchanged. Browser speech changes apply from the next segment.',
361
+ 'dsh-live-voice.speak.volume.label': 'Speech volume',
350
362
  };
351
363
 
352
364
  export default Object.freeze(en);
@@ -128,6 +128,9 @@ const es: LiveVoiceTranslation = {
128
128
  'Con un cuadro de mensaje abierto, mantén Control pulsado en cualquier parte de la página para capturar tu voz. Al soltarlo, se procesa la transcripción pendiente, se espera el retraso de envío configurado, se añade el mensaje a la cola y se cierra la captura de voz. Pulsa Escape mientras mantienes Control para cancelar.',
129
129
  'dsh-live-voice.recognition.language.automatic': 'Automático — detectar idioma',
130
130
  'dsh-live-voice.recognition.language.label': 'Idioma de reconocimiento',
131
+ 'dsh-live-voice.recognition.language.options.chinese': 'Chino (mandarín)',
132
+ 'dsh-live-voice.recognition.language.options.french': 'Francés',
133
+ 'dsh-live-voice.recognition.language.options.spanish': 'Español',
131
134
  'dsh-live-voice.recognition.manualSend.help':
132
135
  'El texto reconocido permanece en el cuadro de mensaje hasta que utilices el botón de envío habitual de DSH.',
133
136
  'dsh-live-voice.recognition.maxUtterance.help':
@@ -259,6 +262,11 @@ const es: LiveVoiceTranslation = {
259
262
  'No se pudieron cargar los ajustes de Voz en vivo del servidor. Recarga para volver a intentarlo.',
260
263
  'dsh-live-voice.settings.persistence.saveError':
261
264
  'No se pudieron guardar los ajustes de Voz en vivo en el servidor. Inténtalo de nuevo.',
265
+ 'dsh-live-voice.settings.sourceNames.help':
266
+ 'Cuando ambas fuentes capturan, estos nombres etiquetan nuevos bloques de transcripción, no participantes individuales. Se guardan al salir del campo; vacío restaura Me / Them. Máximo 80 caracteres. El texto existente no cambia.',
267
+ 'dsh-live-voice.settings.sourceNames.microphone': 'Nombre de la fuente del micrófono',
268
+ 'dsh-live-voice.settings.sourceNames.shared': 'Nombre de la fuente del audio compartido',
269
+ 'dsh-live-voice.settings.sourceNames.title': 'Nombres de fuentes de la reunión',
262
270
  'dsh-live-voice.settings.tabs.conversation': 'Conversación',
263
271
  'dsh-live-voice.settings.tabs.recognition': 'Reconocimiento de voz',
264
272
  'dsh-live-voice.settings.tabs.speak': 'Síntesis de voz',
@@ -285,6 +293,7 @@ const es: LiveVoiceTranslation = {
285
293
  'Lectura automática del asistente: {state} — quedan {count} segmentos de voz',
286
294
  'dsh-live-voice.speak.autoPlayback.status': 'Lectura automática del asistente: {state}',
287
295
  'dsh-live-voice.speak.browser.automaticVoice': 'Voz local automática',
296
+ 'dsh-live-voice.speak.browser.defaultVoice': 'predeterminada',
288
297
  'dsh-live-voice.speak.browser.label': 'Síntesis de voz del navegador — audio en este dispositivo',
289
298
  'dsh-live-voice.speak.browser.name': 'Síntesis de voz del navegador',
290
299
  'dsh-live-voice.speak.browser.outputHelp':
@@ -370,6 +379,9 @@ const es: LiveVoiceTranslation = {
370
379
  'dsh-live-voice.speak.segmentGap.label': 'Pausa entre segmentos de voz',
371
380
  'dsh-live-voice.speak.status.paused': 'Lectura en pausa',
372
381
  'dsh-live-voice.speak.status.playing': 'Hablando',
382
+ 'dsh-live-voice.speak.volume.help':
383
+ 'Solo reproducción de voz: 0% es silencio; 100% es el volumen máximo (predeterminado). El micrófono no cambia. En Browser, los cambios se aplican desde el siguiente segmento.',
384
+ 'dsh-live-voice.speak.volume.label': 'Volumen de voz',
373
385
  };
374
386
 
375
387
  export default Object.freeze(es);
@@ -132,6 +132,9 @@ const fr: LiveVoiceTranslation = {
132
132
  'Lorsqu’une zone de rédaction est ouverte, maintenez Ctrl n’importe où sur la page pour capturer votre voix. Relâchez la touche pour traiter la transcription en attente, attendre le délai d’envoi configuré, mettre le message en file d’attente et arrêter la capture vocale. Appuyez sur Échap tout en maintenant Ctrl pour annuler.',
133
133
  'dsh-live-voice.recognition.language.automatic': 'Automatique — détecter la langue',
134
134
  'dsh-live-voice.recognition.language.label': 'Langue de reconnaissance',
135
+ 'dsh-live-voice.recognition.language.options.chinese': 'Chinois (mandarin)',
136
+ 'dsh-live-voice.recognition.language.options.french': 'Français',
137
+ 'dsh-live-voice.recognition.language.options.spanish': 'Espagnol',
135
138
  'dsh-live-voice.recognition.manualSend.help':
136
139
  'Le texte reconnu reste dans la zone de rédaction jusqu’à ce que vous utilisiez le bouton d’envoi habituel de DSH.',
137
140
  'dsh-live-voice.recognition.maxUtterance.help':
@@ -265,6 +268,11 @@ const fr: LiveVoiceTranslation = {
265
268
  'Impossible de charger les paramètres Voix en direct depuis le serveur. Rechargez pour réessayer.',
266
269
  'dsh-live-voice.settings.persistence.saveError':
267
270
  'Impossible de sauvegarder les paramètres Voix en direct sur le serveur. Réessayez.',
271
+ 'dsh-live-voice.settings.sourceNames.help':
272
+ 'Lorsque les deux sources capturent, ces noms identifient les nouveaux blocs de transcription, pas les participants individuels. Enregistrés en quittant le champ ; vide rétablit Me / Them. Maximum 80 caractères. Le texte existant reste inchangé.',
273
+ 'dsh-live-voice.settings.sourceNames.microphone': 'Nom de la source microphone',
274
+ 'dsh-live-voice.settings.sourceNames.shared': 'Nom de la source audio partagé',
275
+ 'dsh-live-voice.settings.sourceNames.title': 'Noms des sources de réunion',
268
276
  'dsh-live-voice.settings.tabs.conversation': 'Conversation',
269
277
  'dsh-live-voice.settings.tabs.recognition': 'Reconnaissance vocale',
270
278
  'dsh-live-voice.settings.tabs.speak': 'Synthèse vocale',
@@ -291,6 +299,7 @@ const fr: LiveVoiceTranslation = {
291
299
  'Lecture automatique de l’assistant : {state} — {count} segments vocaux restants',
292
300
  'dsh-live-voice.speak.autoPlayback.status': 'Lecture automatique de l’assistant : {state}',
293
301
  'dsh-live-voice.speak.browser.automaticVoice': 'Voix locale automatique',
302
+ 'dsh-live-voice.speak.browser.defaultVoice': 'par défaut',
294
303
  'dsh-live-voice.speak.browser.label': 'Synthèse vocale du navigateur — son sur cet appareil',
295
304
  'dsh-live-voice.speak.browser.name': 'Synthèse vocale du navigateur',
296
305
  'dsh-live-voice.speak.browser.outputHelp':
@@ -375,6 +384,9 @@ const fr: LiveVoiceTranslation = {
375
384
  'dsh-live-voice.speak.segmentGap.label': 'Pause entre les segments vocaux',
376
385
  'dsh-live-voice.speak.status.paused': 'Lecture en pause',
377
386
  'dsh-live-voice.speak.status.playing': 'Lecture en cours',
387
+ 'dsh-live-voice.speak.volume.help':
388
+ 'Lecture vocale uniquement : 0% est silencieux ; 100% est le volume maximal (par défaut). Le microphone reste inchangé. Dans Browser, les changements prennent effet au segment suivant.',
389
+ 'dsh-live-voice.speak.volume.label': 'Volume de la voix',
378
390
  };
379
391
 
380
392
  export default Object.freeze(fr);
@@ -122,6 +122,9 @@ const hi: LiveVoiceTranslation = {
122
122
  'संदेश बॉक्स खुला होने पर, पेज पर कहीं भी Control दबाए रखकर आवाज़ रिकॉर्ड करें। छोड़ने पर कतार में मौजूद ट्रांसक्रिप्शन पूरा किया जाता है, तय भेजने के विलंब तक प्रतीक्षा होती है, संदेश कतार में जुड़ता है और आवाज़ रिकॉर्ड करना बंद हो जाता है। रद्द करने के लिए Control दबाए रखते हुए Escape दबाएँ।',
123
123
  'dsh-live-voice.recognition.language.automatic': 'स्वचालित — भाषा पहचानें',
124
124
  'dsh-live-voice.recognition.language.label': 'वाक् पहचान की भाषा',
125
+ 'dsh-live-voice.recognition.language.options.chinese': 'चीनी (मंदारिन)',
126
+ 'dsh-live-voice.recognition.language.options.french': 'फ़्रेंच',
127
+ 'dsh-live-voice.recognition.language.options.spanish': 'स्पेनिश',
125
128
  'dsh-live-voice.recognition.manualSend.help':
126
129
  'पहचाना गया पाठ संदेश बॉक्स में तब तक रहता है जब तक आप DSH के सामान्य भेजें बटन का उपयोग नहीं करते।',
127
130
  'dsh-live-voice.recognition.maxUtterance.help':
@@ -246,6 +249,11 @@ const hi: LiveVoiceTranslation = {
246
249
  'सर्वर से लाइव वॉइस सेटिंग लोड नहीं हो सकीं। फिर प्रयास करने के लिए पेज रीलोड करें।',
247
250
  'dsh-live-voice.settings.persistence.saveError':
248
251
  'सर्वर पर लाइव वॉइस सेटिंग सेव नहीं हो सकीं। फिर प्रयास करें।',
252
+ 'dsh-live-voice.settings.sourceNames.help':
253
+ 'जब दोनों स्रोत रिकॉर्ड करते हैं, ये नाम नए ट्रांसक्रिप्ट ब्लॉक को चिह्नित करते हैं, अलग-अलग प्रतिभागियों को नहीं। फ़ील्ड छोड़ने पर सहेजे जाते हैं; खाली रखने पर Me / Them वापस आते हैं। अधिकतम 80 अक्षर। मौजूदा पाठ नहीं बदलता।',
254
+ 'dsh-live-voice.settings.sourceNames.microphone': 'माइक्रोफ़ोन स्रोत का नाम',
255
+ 'dsh-live-voice.settings.sourceNames.shared': 'साझा ऑडियो स्रोत का नाम',
256
+ 'dsh-live-voice.settings.sourceNames.title': 'बैठक स्रोतों के नाम',
249
257
  'dsh-live-voice.settings.tabs.conversation': 'बातचीत',
250
258
  'dsh-live-voice.settings.tabs.recognition': 'वाक् पहचान',
251
259
  'dsh-live-voice.settings.tabs.speak': 'वाचन',
@@ -271,6 +279,7 @@ const hi: LiveVoiceTranslation = {
271
279
  'सहायक का स्वचालित वाचन: {state} — {count} वाक् खंड शेष हैं',
272
280
  'dsh-live-voice.speak.autoPlayback.status': 'सहायक का स्वचालित वाचन: {state}',
273
281
  'dsh-live-voice.speak.browser.automaticVoice': 'स्थानीय आवाज़ का स्वचालित चयन',
282
+ 'dsh-live-voice.speak.browser.defaultVoice': 'डिफ़ॉल्ट',
274
283
  'dsh-live-voice.speak.browser.label': 'ब्राउज़र वाचन — इस डिवाइस पर ऑडियो',
275
284
  'dsh-live-voice.speak.browser.name': 'ब्राउज़र वाचन',
276
285
  'dsh-live-voice.speak.browser.outputHelp':
@@ -351,6 +360,9 @@ const hi: LiveVoiceTranslation = {
351
360
  'dsh-live-voice.speak.segmentGap.label': 'बोले गए हिस्सों के बीच विराम',
352
361
  'dsh-live-voice.speak.status.paused': 'वाचन ठहरा हुआ है',
353
362
  'dsh-live-voice.speak.status.playing': 'पढ़कर सुनाया जा रहा है',
363
+ 'dsh-live-voice.speak.volume.help':
364
+ 'केवल वाणी प्लेबैक: 0% मौन है; 100% पूर्ण आवाज़ है (डिफ़ॉल्ट)। माइक्रोफ़ोन नहीं बदलता। Browser में बदलाव अगले खंड से लागू होते हैं।',
365
+ 'dsh-live-voice.speak.volume.label': 'वाणी की आवाज़ का स्तर',
354
366
  };
355
367
 
356
368
  export default Object.freeze(hi);
@@ -126,6 +126,9 @@ const ptBR: LiveVoiceTranslation = {
126
126
  'Com o editor aberto, segure Control em qualquer lugar da página para capturar a fala. Solte para concluir as transcrições pendentes, aguardar o atraso configurado, enfileirar a mensagem e encerrar a captura. Pressione Escape enquanto segura para cancelar.',
127
127
  'dsh-live-voice.recognition.language.automatic': 'Automático — detectar idioma',
128
128
  'dsh-live-voice.recognition.language.label': 'Idioma de reconhecimento',
129
+ 'dsh-live-voice.recognition.language.options.chinese': 'Chinês (mandarim)',
130
+ 'dsh-live-voice.recognition.language.options.french': 'Francês',
131
+ 'dsh-live-voice.recognition.language.options.spanish': 'Espanhol',
129
132
  'dsh-live-voice.recognition.manualSend.help':
130
133
  'O texto reconhecido permanece no editor até que você use o botão normal de envio do DSH.',
131
134
  'dsh-live-voice.recognition.maxUtterance.help':
@@ -252,6 +255,11 @@ const ptBR: LiveVoiceTranslation = {
252
255
  'Não foi possível carregar as configurações da Voz ao Vivo do servidor. Recarregue para tentar novamente.',
253
256
  'dsh-live-voice.settings.persistence.saveError':
254
257
  'Não foi possível salvar as configurações da Voz ao Vivo no servidor. Tente novamente.',
258
+ 'dsh-live-voice.settings.sourceNames.help':
259
+ 'Quando as duas fontes capturam, estes nomes identificam novos blocos da transcrição, não participantes individuais. Salvos ao sair do campo; vazio restaura Me / Them. Máximo de 80 caracteres. O texto existente não muda.',
260
+ 'dsh-live-voice.settings.sourceNames.microphone': 'Nome da fonte do microfone',
261
+ 'dsh-live-voice.settings.sourceNames.shared': 'Nome da fonte do áudio compartilhado',
262
+ 'dsh-live-voice.settings.sourceNames.title': 'Nomes das fontes da reunião',
255
263
  'dsh-live-voice.settings.tabs.conversation': 'Conversa',
256
264
  'dsh-live-voice.settings.tabs.recognition': 'Reconhecimento de voz',
257
265
  'dsh-live-voice.settings.tabs.speak': 'Fala',
@@ -278,6 +286,7 @@ const ptBR: LiveVoiceTranslation = {
278
286
  'Fala automática do assistente: {state} — restam {count} segmentos de fala',
279
287
  'dsh-live-voice.speak.autoPlayback.status': 'Fala automática do assistente: {state}',
280
288
  'dsh-live-voice.speak.browser.automaticVoice': 'Voz local automática',
289
+ 'dsh-live-voice.speak.browser.defaultVoice': 'padrão',
281
290
  'dsh-live-voice.speak.browser.label': 'Fala do navegador — áudio neste dispositivo',
282
291
  'dsh-live-voice.speak.browser.name': 'Fala do navegador',
283
292
  'dsh-live-voice.speak.browser.outputHelp':
@@ -360,6 +369,9 @@ const ptBR: LiveVoiceTranslation = {
360
369
  'dsh-live-voice.speak.segmentGap.label': 'Pausa entre trechos de fala',
361
370
  'dsh-live-voice.speak.status.paused': 'Fala pausada',
362
371
  'dsh-live-voice.speak.status.playing': 'Falando',
372
+ 'dsh-live-voice.speak.volume.help':
373
+ 'Somente reprodução da fala: 0% é silencioso; 100% é o volume máximo (padrão). O microfone não é alterado. No Browser, mudanças valem a partir do próximo trecho.',
374
+ 'dsh-live-voice.speak.volume.label': 'Volume da fala',
363
375
  };
364
376
 
365
377
  export default Object.freeze(ptBR);
@@ -115,6 +115,9 @@ const zh: LiveVoiceTranslation = {
115
115
  '消息输入框打开时,在页面任意位置按住 Control 键即可采集语音。松开后会处理完队列中的转写,等待设定的发送延迟,将消息加入队列,然后关闭语音采集。按住期间按 Escape 键可取消。',
116
116
  'dsh-live-voice.recognition.language.automatic': '自动 — 检测语言',
117
117
  'dsh-live-voice.recognition.language.label': '识别语言',
118
+ 'dsh-live-voice.recognition.language.options.chinese': '中文(普通话)',
119
+ 'dsh-live-voice.recognition.language.options.french': '法语',
120
+ 'dsh-live-voice.recognition.language.options.spanish': '西班牙语',
118
121
  'dsh-live-voice.recognition.manualSend.help':
119
122
  '识别出的文本会保留在消息输入框中,直到你使用 DSH 的常规发送按钮。',
120
123
  'dsh-live-voice.recognition.maxUtterance.help':
@@ -231,6 +234,11 @@ const zh: LiveVoiceTranslation = {
231
234
  'dsh-live-voice.settings.layout.voice': '声音与引擎',
232
235
  'dsh-live-voice.settings.persistence.loadError': '无法从服务器加载 实时语音 设置。请刷新后重试。',
233
236
  'dsh-live-voice.settings.persistence.saveError': '无法在服务器上保存 实时语音 设置。请重试。',
237
+ 'dsh-live-voice.settings.sourceNames.help':
238
+ '同时采集两个音源时,这些名称标记新的转录段落,而非各个参会者。离开输入框时保存;留空恢复 Me / Them。最多 80 个字符。现有文本不会改变。',
239
+ 'dsh-live-voice.settings.sourceNames.microphone': '麦克风音源名称',
240
+ 'dsh-live-voice.settings.sourceNames.shared': '共享音频音源名称',
241
+ 'dsh-live-voice.settings.sourceNames.title': '会议音源名称',
234
242
  'dsh-live-voice.settings.tabs.conversation': '对话',
235
243
  'dsh-live-voice.settings.tabs.recognition': '语音识别',
236
244
  'dsh-live-voice.settings.tabs.speak': '语音合成',
@@ -255,6 +263,7 @@ const zh: LiveVoiceTranslation = {
255
263
  '助手自动朗读:{state} — 剩余 {count} 个语音片段',
256
264
  'dsh-live-voice.speak.autoPlayback.status': '助手自动朗读:{state}',
257
265
  'dsh-live-voice.speak.browser.automaticVoice': '自动选择本地语音',
266
+ 'dsh-live-voice.speak.browser.defaultVoice': '默认',
258
267
  'dsh-live-voice.speak.browser.label': '浏览器语音合成 — 在此设备播放',
259
268
  'dsh-live-voice.speak.browser.name': '浏览器语音合成',
260
269
  'dsh-live-voice.speak.browser.outputHelp':
@@ -330,6 +339,9 @@ const zh: LiveVoiceTranslation = {
330
339
  'dsh-live-voice.speak.segmentGap.label': '语音片段之间的停顿',
331
340
  'dsh-live-voice.speak.status.paused': '语音已暂停',
332
341
  'dsh-live-voice.speak.status.playing': '正在朗读',
342
+ 'dsh-live-voice.speak.volume.help':
343
+ '仅调整语音播放:0% 为静音,100% 为最大音量(默认)。不改变麦克风输入。Browser 的更改从下一语音片段生效。',
344
+ 'dsh-live-voice.speak.volume.label': '语音音量',
333
345
  };
334
346
 
335
347
  export default Object.freeze(zh);
@@ -24,7 +24,7 @@ export class MeetingController {
24
24
  this.t = translate;
25
25
  this.onActivity = onActivity;
26
26
  this.onSpeech = onSpeech;
27
- this.transcript = new MeetingTranscript(composer);
27
+ this.transcript = new MeetingTranscript(composer, settings);
28
28
  this.jobs = new Map();
29
29
  this.generations = new Map();
30
30
  this.listeners = new Set();
@@ -1,3 +1,5 @@
1
+ import { defaultSettings, normalizeSourceName } from '../../core/settings.js';
2
+
1
3
  export type MeetingSource = 'microphone' | 'shared';
2
4
 
3
5
  /** One composer writer; independent recognizers deliver final chunks in arrival order. */
@@ -16,7 +18,11 @@ export class MeetingTranscript {
16
18
  this.timestamps = enabled;
17
19
  this.last = null;
18
20
  }
19
- constructor(private composer: { getDraft(): string; setDraft(text: string): void }) {}
21
+ constructor(
22
+ private composer: { getDraft(): string; setDraft(text: string): void },
23
+ private settings: () => { microphoneSourceName?: string; sharedSourceName?: string } = () =>
24
+ defaultSettings,
25
+ ) {}
20
26
  setActive(source: MeetingSource, enabled: boolean) {
21
27
  if (enabled) this.active.add(source);
22
28
  else this.active.delete(source);
@@ -48,7 +54,9 @@ export class MeetingTranscript {
48
54
  pad(date.getSeconds()) +
49
55
  '] '
50
56
  : '';
51
- const prefix = changed ? stamp + (labelled ? (source === 'microphone' ? 'Me: ' : 'Them: ') : '') : '';
57
+ const key = source === 'microphone' ? 'microphoneSourceName' : 'sharedSourceName';
58
+ const name = normalizeSourceName(this.settings()[key], defaultSettings[key]);
59
+ const prefix = changed ? stamp + (labelled ? name + ': ' : '') : '';
52
60
  const separator = draft ? (changed ? '\n\n' : '\n') : '';
53
61
  const next = draft + separator + prefix + chunk;
54
62
  this.composer.setDraft(next);
@@ -135,6 +135,9 @@ export class VoiceCoordinator {
135
135
  (key) => Object.hasOwn(next, key) && settings[key] !== previousSettings[key],
136
136
  );
137
137
  if (speechPreparationChanged) this._cancelSpeechPrefetch();
138
+ if (settings.volume !== previousSettings.volume) {
139
+ this.engines[this.snapshot.speechEngine || settings.engine]?.setVolume?.(settings.volume);
140
+ }
138
141
  this.meter.deviceId = settings.inputDeviceId;
139
142
  Object.assign(this.recognition, {
140
143
  lang: settings.recognitionLang,
@@ -813,6 +816,7 @@ export class VoiceCoordinator {
813
816
  const options = {
814
817
  voice: this.snapshot.settings.voice || undefined,
815
818
  rate: this.snapshot.settings.rate,
819
+ volume: this.snapshot.settings.volume,
816
820
  lang: this.snapshot.settings.lang,
817
821
  outputDeviceId: this.snapshot.settings.outputDeviceId,
818
822
  };
@@ -1185,6 +1189,7 @@ export class VoiceCoordinator {
1185
1189
  },
1186
1190
  voice: this.snapshot.settings.voice || undefined,
1187
1191
  rate: this.snapshot.settings.rate,
1192
+ volume: this.snapshot.settings.volume,
1188
1193
  outputDeviceId: this.snapshot.settings.outputDeviceId,
1189
1194
  signal: controller.signal,
1190
1195
  };
@@ -1200,6 +1205,7 @@ export class VoiceCoordinator {
1200
1205
  await this._waitSpeechLaunch(controller.signal);
1201
1206
  if (epoch !== this.speechEpoch || this.disposed) return;
1202
1207
  this.speechLaunchPending = false;
1208
+ options.volume = this.snapshot.settings.volume;
1203
1209
  if (queued?.prepared && typeof engine.playPrepared === 'function') {
1204
1210
  const prepared = queued.prepared;
1205
1211
  this.prefetchItems.delete(queued);
@@ -69,6 +69,8 @@ export const defaultSettings = Object.freeze({
69
69
  sharedVoiceCommandsEnabled: true,
70
70
  timestampsEnabled: false,
71
71
  sharedTimestampsEnabled: false,
72
+ microphoneSourceName: 'Me',
73
+ sharedSourceName: 'Them',
72
74
  voiceCommandSend: 'send, send message',
73
75
  voiceCommandQueue: 'queue, queue message',
74
76
  voiceCommandEnd: 'end, end conversation',
@@ -80,8 +82,17 @@ export const defaultSettings = Object.freeze({
80
82
  outputCodeMaxLines: 5,
81
83
  outputCodeNotice: resolveCodeNotice(undefined, 'pt-BR'),
82
84
  rate: 1,
85
+ volume: 1,
83
86
  segmentGapMs: 400,
84
87
  });
88
+ /** Source names are single-line labels, not transcript markup. Empty/invalid values restore defaults. */
89
+ export const normalizeSourceName = (value, fallback) => {
90
+ if (typeof value !== 'string' || /[\u0000-\u001f\u007f-\u009f\u2028\u2029]/u.test(value))
91
+ return fallback;
92
+ const name = value.trim();
93
+ return name && name.length <= 80 ? name : fallback;
94
+ };
95
+
85
96
  const normalizeCommandPhrases = (value, fallback) =>
86
97
  typeof value === 'string' && value.length <= 1000 && !value.includes('\0')
87
98
  ? value
@@ -125,7 +136,8 @@ export function normalizeSettings(value) {
125
136
  ? source.recognitionAutoInstall
126
137
  : defaultSettings.recognitionAutoInstall,
127
138
  voiceDetectionEngine: ['energy', 'silero'].includes(source.voiceDetectionEngine)
128
- ? source.voiceDetectionEngine : defaultSettings.voiceDetectionEngine,
139
+ ? source.voiceDetectionEngine
140
+ : defaultSettings.voiceDetectionEngine,
129
141
  voiceDetectionPreset:
130
142
  source.voiceDetectionPreset === 'custom' ||
131
143
  Object.hasOwn(voiceDetectionPresets, source.voiceDetectionPreset)
@@ -225,8 +237,18 @@ export function normalizeSettings(value) {
225
237
  typeof source.voiceCommandsEnabled === 'boolean'
226
238
  ? source.voiceCommandsEnabled
227
239
  : defaultSettings.voiceCommandsEnabled,
228
- timestampsEnabled: typeof source.timestampsEnabled === 'boolean' ? source.timestampsEnabled : false,
229
- sharedTimestampsEnabled: typeof source.sharedTimestampsEnabled === 'boolean' ? source.sharedTimestampsEnabled : false,
240
+ microphoneSourceName: normalizeSourceName(
241
+ source.microphoneSourceName,
242
+ defaultSettings.microphoneSourceName,
243
+ ),
244
+ sharedSourceName: normalizeSourceName(
245
+ source.sharedSourceName,
246
+ defaultSettings.sharedSourceName,
247
+ ),
248
+ timestampsEnabled:
249
+ typeof source.timestampsEnabled === 'boolean' ? source.timestampsEnabled : false,
250
+ sharedTimestampsEnabled:
251
+ typeof source.sharedTimestampsEnabled === 'boolean' ? source.sharedTimestampsEnabled : false,
230
252
  sharedVoiceCommandsEnabled:
231
253
  typeof source.sharedVoiceCommandsEnabled === 'boolean'
232
254
  ? source.sharedVoiceCommandsEnabled
@@ -279,6 +301,10 @@ export function normalizeSettings(value) {
279
301
  ? resolveCodeNotice(source.outputCodeNotice, source.lang || defaultSettings.lang)
280
302
  : resolveCodeNotice(defaultSettings.outputCodeNotice, source.lang || defaultSettings.lang),
281
303
  rate: Number.isFinite(source.rate) && source.rate >= 0.1 && source.rate <= 3 ? source.rate : 1,
304
+ volume:
305
+ Number.isFinite(source.volume) && source.volume >= 0 && source.volume <= 1
306
+ ? source.volume
307
+ : 1,
282
308
  segmentGapMs:
283
309
  Number.isFinite(source.segmentGapMs) &&
284
310
  source.segmentGapMs >= 0 &&
@@ -6,4 +6,6 @@
6
6
 
7
7
  Engine choice is configuration, not operational validation: every STT/TTS option stays selectable without provider health requests. Configuration load/save uses only the authenticated preference/config routes; explicit Test or start/play performs operational validation. Shared `core/engineSelection.ts` determines display order and new host preference defaults from authenticated host-platform metadata, never inferring actual support or overwriting valid saved choices. UI discovery refreshes only local voices, capture metadata, and playback-control mechanics.
8
8
 
9
+ `models/browserVoiceSelection.ts` owns pure Browser voice ranking and explicit engine-transition defaults. Rank available local voices by the Natural name label, client browser language family, then alphabetical name; this label is a preference hint, not a capability or quality guarantee. UI translation locale and host OS do not select speech language. Only an explicit transition to Browser preselects a discovered Natural voice. Empty discovery keeps the existing preference; subsequent asynchronous capability refreshes re-rank options without retroactively selecting a voice or overwriting manual choices. The selector groups voices by language family using native optgroups, with the browser language first, other languages alphabetically, and unknown language last; within each section Natural voices precede alphabetical names. The preferred Natural voice keeps a localized default suffix independent of the currently selected voice. Grouping does not change transition-default policy. No speech-language setting is changed.
10
+
9
11
  Preserve existing setting names, default values, handlers, and normalization in `../core/settings.ts`; reorganizing presentation must not silently change policy. Keep transient capability/permission messages visible even when an options section is collapsed. User-facing copy and accessible names belong in all typed catalogs under `src/app/client/i18n`; UI locale does not select recognition or speech language. The preview in `__previewjs__/LiveVoicePreviews.tsx` exercises presentation with a fake controller, not a physical microphone or authenticated DSH runtime. Run `npm test` after changes and check the preview for layout and interaction.
@@ -0,0 +1,76 @@
1
+ /** Settings policy for the local voices exposed by BrowserSpeakingEngine. */
2
+ export interface BrowserVoice {
3
+ readonly name: string;
4
+ readonly voiceURI?: string;
5
+ readonly lang?: string;
6
+ }
7
+
8
+ function baseLanguage(language: string | undefined): string {
9
+ return (language ?? '').trim().replace(/_/g, '-').split('-')[0].toLowerCase();
10
+ }
11
+
12
+ export function isNaturalVoice(voice: BrowserVoice): boolean {
13
+ return /\bnatural\b/i.test(voice.name);
14
+ }
15
+
16
+ /** Natural label, browser language family, then name. Never mutates discovery data. */
17
+ export function rankBrowserVoices<T extends BrowserVoice>(
18
+ voices: readonly T[],
19
+ browserLanguage?: string,
20
+ ): T[] {
21
+ const language = baseLanguage(browserLanguage);
22
+ const matches = (voice: BrowserVoice) =>
23
+ Boolean(language) && baseLanguage(voice.lang) === language;
24
+ return [...voices].sort(
25
+ (a, b) =>
26
+ Number(isNaturalVoice(b)) - Number(isNaturalVoice(a)) ||
27
+ Number(matches(b)) - Number(matches(a)) ||
28
+ a.name.localeCompare(b.name),
29
+ );
30
+ }
31
+
32
+ /** Language sections prioritize the browser language; voices retain Natural/name ranking. */
33
+ export function groupBrowserVoices<T extends BrowserVoice>(
34
+ voices: readonly T[],
35
+ browserLanguage?: string,
36
+ ): { language: string; voices: T[] }[] {
37
+ const groups = new Map<string, T[]>();
38
+ for (const voice of rankBrowserVoices(voices, browserLanguage)) {
39
+ const language = baseLanguage(voice.lang);
40
+ const group = groups.get(language) ?? [];
41
+ group.push(voice);
42
+ groups.set(language, group);
43
+ }
44
+ const preferredLanguage = baseLanguage(browserLanguage);
45
+ return [...groups]
46
+ .map(([language, voices]) => ({ language, voices }))
47
+ .sort(
48
+ (a, b) =>
49
+ Number(Boolean(preferredLanguage) && b.language === preferredLanguage) -
50
+ Number(Boolean(preferredLanguage) && a.language === preferredLanguage) ||
51
+ Number(!a.language) - Number(!b.language) ||
52
+ a.language.localeCompare(b.language),
53
+ );
54
+ }
55
+
56
+ export function preferredBrowserVoice(
57
+ voices: readonly BrowserVoice[],
58
+ browserLanguage?: string,
59
+ ): string | undefined {
60
+ const voice = rankBrowserVoices(voices, browserLanguage).find(isNaturalVoice);
61
+ return voice ? voice.voiceURI || voice.name : undefined;
62
+ }
63
+
64
+ /** Only an explicit engine transition may select a default; renders/discovery cannot. */
65
+ export function speechEngineSelectionPatch(
66
+ currentEngine: string,
67
+ nextEngine: string,
68
+ voices: readonly BrowserVoice[],
69
+ browserLanguage?: string,
70
+ ): { engine: string; voice?: string } {
71
+ const voice =
72
+ nextEngine === 'browser' && currentEngine !== 'browser'
73
+ ? preferredBrowserVoice(voices, browserLanguage)
74
+ : undefined;
75
+ return { engine: nextEngine, ...(voice === undefined ? {} : { voice }) };
76
+ }
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { useLanguage } from '../../../../app/client/i18n/index.js';
3
+ import { SettingsSection } from '../../../../shared/design-system/index.js';
4
+ import { DraftField } from '../../../../shared/design-system/forms/DraftField.js';
5
+
6
+ export function MeetingSourceSettings({ settings, updateSettings }: {
7
+ settings: any;
8
+ updateSettings(value: any): void;
9
+ }) {
10
+ const { scoped: language } = useLanguage((ctx) => ctx.settings);
11
+ const { scoped: meeting } = useLanguage((ctx) => ctx.meeting);
12
+ const names = (language as any).sourceNames;
13
+ return (
14
+ <SettingsSection title={(meeting as any).title()} icon="meeting" defaultOpen={false}>
15
+ <p>{names.help()}</p>
16
+ <DraftField
17
+ label={names.microphone()}
18
+ value={settings.microphoneSourceName}
19
+ maxLength={80}
20
+ onCommit={(microphoneSourceName) => updateSettings({ microphoneSourceName })}
21
+ />
22
+ <DraftField
23
+ label={names.shared()}
24
+ value={settings.sharedSourceName}
25
+ maxLength={80}
26
+ onCommit={(sharedSourceName) => updateSettings({ sharedSourceName })}
27
+ />
28
+ </SettingsSection>
29
+ );
30
+ }