The best way to control Claude Code, Codex and more from any computer or phone
feat(voice): add a native streaming transcription toggle (#34380)
Utkarsh Patil committed
Nov 17, 2026 at 00:57 UTC
4247b5aa1a1d0e4115a9bcf3860f24e6f435fb52
12 files changed
+353
-12
apps/server/src/speech/SpeechService.ts
+4
-3
@@ -582,8 +582,9 @@ const make = Effect.gen(function* () {
582
const silenceModelPath = Effect.fn("SpeechService.silenceModelPath")(function* (
583
loaded: LoadedModel,
584
options: SpeechTranscriptionOptions,
585
+ nativeStreaming: boolean,
586
) {
586
- if (!options.speechSilenceFiltering && (loaded.supportsStreaming || loaded.supportsLongForm))
587
+ if (!options.speechSilenceFiltering && (nativeStreaming || loaded.supportsLongForm))
588
return undefined;
589
return yield* acquireSilenceModel("recording");
590
});
@@ -619,7 +620,7 @@ const make = Effect.gen(function* () {
620
),
621
catch: (cause) => speechError("model preparation", cause),
622
});
622
- const vadPath = yield* silenceModelPath(loaded, options);
623
+ const vadPath = yield* silenceModelPath(loaded, options, false);
624
const dictionary = normalizeSpeechCustomWords(options.speechCustomWords);
625
const customWords = dictionary.map(({ term }) => term);
626
// The vocabulary capability guarantees plain transcription, not translation.
@@ -755,7 +756,7 @@ const make = Effect.gen(function* () {
756
loadModel(modelPath, definition, signal, settings.speechAcceleration),
757
);
758
loaded = streamModel;
758
- const vadPath = yield* silenceModelPath(streamModel, options);
759
+ const vadPath = yield* silenceModelPath(streamModel, options, streamModel.supportsStreaming);
760
let translateToEnglish = false;
761
const beginStream = async () => {
762
translateToEnglish =
apps/server/src/speech/native.test.ts
+22
@@ -299,6 +299,28 @@ it("decodes complete stable chunks before Stop and returns the ordered final tai
299
}
300
});
301
302
+it("uses bounded offline chunks for a native streaming model without opening a session", async () => {
303
+ const moduleUrl = `data:text/javascript,${encodeURIComponent(`
304
+ export const TranscribeModel = { load: async () => ({
305
+ capabilities: { supportsStreaming: true, maxAudioMs: 4000 },
306
+ supports: () => false,
307
+ createSession: () => { throw new Error("Offline inference must not open a stream"); },
308
+ transcribe: async pcm => {
309
+ if (pcm.length > 32000) throw new Error("Model input limit exceeded");
310
+ return { text: String(pcm.length) };
311
+ },
312
+ }) };
313
+ `)}`;
314
+ const model = await loadNativeSpeechModel("asr.gguf", new AbortController().signal, moduleUrl);
315
+ try {
316
+ expect(
317
+ await model.transcribe(new Float32Array(48002).fill(0.8), { timestamps: "none" }, false),
318
+ ).toEqual({ text: "32000 16002" });
319
+ } finally {
320
+ await model.dispose();
321
+ }
322
+});
323
+
324
it("preserves withheld audio on VAD failure while keeping ASR failures distinct", async () => {
325
for (const streaming of [false, true]) {
326
const model = await loadNativeSpeechModel(
apps/server/src/speech/native.ts
+2
-2
@@ -28,7 +28,7 @@ const resetAsr = () => {
28
stream = session = undefined;
29
};
30
const newAudio = (filterSilence) => createSpeechAudio({
31
- frameSamples: 512, filterSilence, nativeStreaming: model.capabilities.supportsStreaming,
31
+ frameSamples: 512, filterSilence, nativeStreaming,
32
longForm: model.supports("long_form"), maxAudioMs: model.capabilities.maxAudioMs,
33
});
34
const openAsr = async () => {
@@ -45,7 +45,7 @@ const begin = async (message, live) => {
45
scored = revision = 0;
46
heardAudio = false;
47
useVad = Boolean(message.vadPath) && (message.filterSilence ||
48
- (!model.capabilities.supportsStreaming && !model.supports("long_form")));
48
+ (!nativeStreaming && !model.supports("long_form")));
49
if (useVad) {
50
try {
51
if (!vadModel) {
apps/web/src/components/settings/VoiceSettingsPanel.browser.test.tsx
+27
-1
@@ -14,6 +14,7 @@ import { expect, it, vi } from "vite-plus/test";
14
import { userEvent } from "vite-plus/test/browser";
15
import { render } from "../../../test/render";
16
import { __setClientSettingsForTests, getClientSettings } from "../../hooks/useSettings";
17
+import { readBrowserClientSettings } from "../../clientPersistenceStorage";
18
import { chooseRecordingMicrophone } from "../../speech/browserMicrophones";
19
import {
20
useEnvironmentSpeechInput,
@@ -121,7 +122,7 @@ it.each([{ cpu: null, accelerated: 2.1 }, { cpu: 5, accelerated: null }, { accel
122
modelId: "both",
123
model: "Bilingual",
124
size: 100,
124
- supportsStreaming: false,
125
+ supportsStreaming: true,
126
supportsTranslation: false,
127
acceleration: "auto",
128
modelUnloadTimeout: "never",
@@ -171,6 +172,10 @@ it.each([{ cpu: null, accelerated: 2.1 }, { cpu: 5, accelerated: null }, { accel
172
prepared,
173
}),
174
async () => {
175
+ const previous = getClientSettings();
176
+ using cleanup = new DisposableStack();
177
+ cleanup.defer(() => __setClientSettingsForTests(previous));
178
+ __setClientSettingsForTests({ ...previous, speechStreaming: true });
179
const panel = () => (
180
<SettingsScopeProvider search={{}} onChange={() => {}}>
181
<VoiceSettingsPanel />
@@ -178,6 +183,13 @@ it.each([{ cpu: null, accelerated: 2.1 }, { cpu: 5, accelerated: null }, { accel
183
);
184
await using screen = await render(panel());
185
await expect.element(screen.getByText(cpuBenchmark)).toBeVisible();
186
+ await userEvent.click(screen.getByRole("button", { name: "Advanced", exact: true }));
187
+ const streaming = screen.getByRole("switch", { name: "Streaming transcription" });
188
+ await expect.element(streaming).toBeEnabled();
189
+ await expect.element(streaming).toBeChecked();
190
+ streaming.element().focus();
191
+ await userEvent.keyboard(" ");
192
+ await vi.waitFor(() => expect(readBrowserClientSettings()?.speechStreaming).toBe(false));
193
prepared = remote;
194
await screen.rerender(panel());
195
await remoteRequested.promise;
@@ -185,15 +197,28 @@ it.each([{ cpu: null, accelerated: 2.1 }, { cpu: 5, accelerated: null }, { accel
197
remoteStatus.resolve(
198
Response.json({
199
...status,
200
+ supportsStreaming: false,
201
benchmarkTier: "accelerated",
202
gpuDevices: [{ id: "gpu", name: "Remote GPU" }],
203
}),
204
);
205
await expect.element(screen.getByText(gpuBenchmark)).toBeVisible();
206
+ await userEvent.click(screen.getByRole("button", { name: "Advanced", exact: true }));
207
+ await expect.element(streaming).toBeDisabled();
208
+ await expect.element(streaming).not.toBeChecked();
209
+ await expect
210
+ .element(screen.getByText("This model doesn’t support native streaming."))
211
+ .toBeVisible();
212
prepared = local;
213
await screen.rerender(panel());
214
await expect.element(screen.getByText(cpuBenchmark)).toBeVisible();
215
+ await userEvent.click(screen.getByRole("button", { name: "Advanced", exact: true }));
216
await expect.element(screen.getByText(gpuBenchmark)).not.toBeInTheDocument();
217
+ await expect.element(streaming).toBeEnabled();
218
+ await expect.element(streaming).not.toBeChecked();
219
+ streaming.element().focus();
220
+ await userEvent.keyboard(" ");
221
+ await vi.waitFor(() => expect(readBrowserClientSettings()?.speechStreaming).toBe(true));
222
},
223
);
224
},
@@ -517,6 +542,7 @@ it("recovers from a failed download progress poll without notifying, but reports
542
it.each([
543
["speech-models", "voice-transcription-destination"],
544
["speech-hardware", "voice-transcription-destination"],
545
+ ["speech-streaming", "voice-transcription-destination"],
546
["transcription-test", "voice-transcription-destination"],
547
["speech-correction-word", "speech-post-processing"],
548
["speech-post-processing-model", "speech-post-processing"],
apps/web/src/components/settings/VoiceSettingsPanel.tsx
+25
-1
@@ -728,11 +728,34 @@ function AdvancedSpeechSettings({
728
prepared: PreparedConnection;
729
catalog: VoiceModels;
730
}) {
731
+ const settings = useClientSettings();
732
const { run, controlsDisabled, status } = catalog;
733
if (!status?.supported) return null;
734
const supported = status;
735
return (
735
- <AdvancedSettings targetIds={[searchableSetting("speech-hardware").id]}>
736
+ <AdvancedSettings
737
+ targetIds={[
738
+ searchableSetting("speech-streaming").id,
739
+ searchableSetting("speech-hardware").id,
740
+ ]}
741
+ >
742
+ <SettingsRow
743
+ {...searchableSetting("speech-streaming")}
744
+ title="Streaming transcription"
745
+ description={
746
+ supported.supportsStreaming
747
+ ? "Transcribe while recording. Turn off to transcribe after stopping, which may help when live transcription falls behind."
748
+ : "This model doesn’t support native streaming."
749
+ }
750
+ control={
751
+ <Switch
752
+ aria-label="Streaming transcription"
753
+ disabled={!supported.supportsStreaming}
754
+ checked={settings.speechStreaming}
755
+ onCheckedChange={(checked) => void updateClientSettings({ speechStreaming: checked })}
756
+ />
757
+ }
758
+ />
759
<SettingsRow
760
{...searchableSetting("speech-hardware")}
761
title="Hardware"
@@ -1276,6 +1299,7 @@ export function VoiceSettingsPanel() {
1299
model || destination.cloudProvider ? undefined : "voice-transcription-destination",
1300
"speech-models": prepared ? undefined : "voice-transcription-destination",
1301
"speech-hardware": prepared && model ? undefined : "voice-transcription-destination",
1302
+ "speech-streaming": prepared && model ? undefined : "voice-transcription-destination",
1303
"transcription-test": !prepared
1304
? "voice-transcription-destination"
1305
: !model || model.state === "missing-model"
apps/web/src/components/settings/settingsSearch.ts
+6
@@ -625,6 +625,12 @@ export const SETTINGS_SEARCH_ITEMS = [
625
to: "/settings/voice",
626
searchTerms: ["speech voice stt advanced gpu cpu acceleration memory unload idle"],
627
},
628
+ {
629
+ id: "speech-streaming",
630
+ title: "Streaming transcription",
631
+ to: "/settings/voice",
632
+ searchTerms: ["speech voice stt advanced native live preview batch after stopping slow lag"],
633
+ },
634
{
635
id: "microphone-test",
636
title: "Test microphone",
apps/web/src/speech/browserVoiceInput.browser.test.ts
new
+250
@@ -0,0 +1,250 @@
1
+import { BearerConnectionTarget } from "@t3tools/client-runtime/connection";
2
+import { VoiceInputController } from "@t3tools/client-runtime/voice-input";
3
+import {
4
+ DEFAULT_SPEECH_TRANSCRIPTION_OPTIONS,
5
+ EnvironmentId,
6
+ type EnvironmentSpeechStatus,
7
+} from "@t3tools/contracts";
8
+import { decodeSpeechPcmRequest } from "@t3tools/shared/speech";
9
+import { expect, it, vi } from "vite-plus/test";
10
+
11
+import { stubGlobal } from "../../test/render";
12
+import { createBrowserVoiceInputPlatform } from "./browserVoiceInput";
13
+
14
+vi.mock("../connection/runtime", async () => {
15
+ const [{ Atom }, { layerRemoteHttpClient }] = await Promise.all([
16
+ import("effect/reactivity"),
17
+ import("@t3tools/client-runtime/rpc"),
18
+ ]);
19
+ return {
20
+ connectionAtomRuntime: Atom.runtime(
21
+ layerRemoteHttpClient((input, init) => globalThis.fetch(input, init)),
22
+ ),
23
+ };
24
+});
25
+
26
+function capture() {
27
+ let receive: ((event: { data: Float32Array | "stopped" }) => void) | undefined;
28
+ const stopTrack = vi.fn();
29
+ const resources = new DisposableStack();
30
+ resources.use(
31
+ stubGlobal(
32
+ "AudioContext",
33
+ class {
34
+ audioWorklet = { addModule: async () => {} };
35
+ createMediaStreamSource() {
36
+ return { connect() {} };
37
+ }
38
+ resume = async () => {};
39
+ close = async () => {};
40
+ },
41
+ ),
42
+ );
43
+ resources.use(
44
+ stubGlobal(
45
+ "AudioWorkletNode",
46
+ class {
47
+ port = {
48
+ set onmessage(handler: typeof receive) {
49
+ receive = handler;
50
+ },
51
+ postMessage(message: string) {
52
+ if (message === "stop") receive?.({ data: "stopped" });
53
+ },
54
+ close() {},
55
+ };
56
+ connect() {}
57
+ disconnect() {}
58
+ },
59
+ ),
60
+ );
61
+ resources.use(
62
+ vi.spyOn(navigator.mediaDevices, "getUserMedia").mockResolvedValue({
63
+ getTracks: () => [{ stop: stopTrack, addEventListener() {} }],
64
+ } as unknown as MediaStream),
65
+ );
66
+ return {
67
+ feed: (data: Float32Array) => receive?.({ data }),
68
+ stopTrack,
69
+ [Symbol.dispose]: () => resources.dispose(),
70
+ };
71
+}
72
+
73
+const target = new BearerConnectionTarget({
74
+ environmentId: EnvironmentId.make("remote-transcription"),
75
+ label: "Remote transcription",
76
+ connectionId: "remote",
77
+});
78
+const prepared = {
79
+ environmentId: target.environmentId,
80
+ label: target.label,
81
+ target,
82
+ httpBaseUrl: "https://transcription.example.test",
83
+ socketUrl: "wss://transcription.example.test/ws",
84
+ httpAuthorization: { _tag: "Bearer" as const, token: "audio-grant" },
85
+};
86
+const status = {
87
+ supported: true,
88
+ state: "ready",
89
+ modelId: "native-streaming",
90
+ model: "Native streaming",
91
+ size: 1,
92
+ supportsStreaming: true,
93
+ supportsBufferedStreaming: true,
94
+ supportsTranslation: true,
95
+ languages: ["en", "fr"],
96
+ supportsLanguageDetection: false,
97
+ acceleration: "cpu",
98
+ modelUnloadTimeout: "never",
99
+ gpuDevices: [],
100
+ benchmarkTier: "cpu",
101
+} satisfies EnvironmentSpeechStatus;
102
+
103
+it("retains all PCM until stop, retries batch audio, and captures preferences before status resolves", async () => {
104
+ using microphone = capture();
105
+ let streaming = false;
106
+ let options = { ...DEFAULT_SPEECH_TRANSCRIPTION_OPTIONS, speechLanguage: "fr" };
107
+ const requests: Array<{ pcm: Uint8Array; options: typeof options }> = [];
108
+ let resolveStatus!: (response: Response) => void;
109
+ const pendingStatus = new Promise<Response>((resolve) => {
110
+ resolveStatus = resolve;
111
+ });
112
+ const fetch = globalThis.fetch;
113
+ using _network = vi.spyOn(globalThis, "fetch").mockImplementation(async (input, init) => {
114
+ const request = new Request(input, init);
115
+ if (request.url === `${prepared.httpBaseUrl}/api/voice/status`)
116
+ return (await pendingStatus).clone();
117
+ if (request.url === `${prepared.httpBaseUrl}/api/voice/transcribe`) {
118
+ expect(request.headers.get("authorization")).toBe("Bearer audio-grant");
119
+ requests.push(decodeSpeechPcmRequest(new Uint8Array(await request.arrayBuffer())));
120
+ return requests.length === 1
121
+ ? new Response(null, { status: 503 })
122
+ : Response.json({ text: "bonjour" });
123
+ }
124
+ return fetch(input, init);
125
+ });
126
+ const onError = vi.fn();
127
+ const platform = createBrowserVoiceInputPlatform({
128
+ prepared,
129
+ hasAudioConsent: () => true,
130
+ getStreamingEnabled: () => streaming,
131
+ getTranscriptionOptions: () => options,
132
+ getMicrophoneId: () => "",
133
+ onLevel() {},
134
+ onDurationLimit() {},
135
+ onText() {},
136
+ onError,
137
+ });
138
+ const commitDraft = vi.fn();
139
+ const controller = new VoiceInputController({
140
+ recorder: platform.recorder,
141
+ retryFailedRecording: true,
142
+ getTranscriber: () => platform.transcriber,
143
+ requestPermission: async () => ({ granted: true, canAskAgain: true }),
144
+ configureRecording: async () => {},
145
+ releaseRecording: async () => platform.cancelRecording(),
146
+ deleteRecording: platform.deleteRecording,
147
+ readDraft: () => ({
148
+ ownerKey: "draft",
149
+ text: "",
150
+ selection: { start: 0, end: 0 },
151
+ revision: 0,
152
+ }),
153
+ commitDraft,
154
+ onStateChange() {},
155
+ });
156
+ using _controller = { [Symbol.dispose]: () => controller.dispose() };
157
+ const start = controller.start();
158
+ await vi.waitFor(() => expect(_network).toHaveBeenCalled());
159
+ streaming = true;
160
+ options = { ...options, speechLanguage: "en" };
161
+ resolveStatus(Response.json(status));
162
+ await start;
163
+ expect(controller.currentState.phase).toBe("recording");
164
+ microphone.feed(new Float32Array([0.1, 0.2]));
165
+ microphone.feed(new Float32Array([0.3]));
166
+ expect(requests).toHaveLength(0);
167
+ await controller.stop();
168
+ expect(controller.currentState.phase).toBe("error");
169
+ expect(platform.recorder.uri).not.toBeNull();
170
+ await controller.start();
171
+ expect(controller.currentState.phase).toBe("idle");
172
+ expect(commitDraft).toHaveBeenCalledWith("bonjour", { start: 7, end: 7 });
173
+ expect(requests).toHaveLength(2);
174
+ for (const request of requests) {
175
+ expect([...new Float32Array(request.pcm.slice().buffer)]).toEqual([
176
+ Math.fround(0.1),
177
+ Math.fround(0.2),
178
+ Math.fround(0.3),
179
+ ]);
180
+ expect(request.options.speechLanguage).toBe("fr");
181
+ }
182
+ expect(platform.recorder.uri).toBeNull();
183
+ expect(microphone.stopTrack).toHaveBeenCalledOnce();
184
+ expect(onError).not.toHaveBeenCalled();
185
+ streaming = false;
186
+ await controller.start();
187
+ microphone.feed(new Float32Array([0.4]));
188
+ controller.cancel();
189
+ await vi.waitFor(() => expect(microphone.stopTrack).toHaveBeenCalledTimes(2));
190
+ expect(requests).toHaveLength(2);
191
+ expect(platform.recorder.uri).toBeNull();
192
+});
193
+
194
+it.each([
195
+ { native: true, enabled: true, buffered: true, live: true },
196
+ { native: true, enabled: false, buffered: true, live: false },
197
+ { native: false, enabled: false, buffered: true, live: true },
198
+ { native: false, enabled: true, buffered: true, live: true },
199
+ { native: false, enabled: false, buffered: false, live: false },
200
+])(
201
+ "selects the destination model's processing path: %j",
202
+ async ({ native, enabled, buffered, live }) => {
203
+ const sockets: string[] = [];
204
+ using _socket = stubGlobal(
205
+ "WebSocket",
206
+ class extends EventTarget {
207
+ constructor(url: string) {
208
+ super();
209
+ sockets.push(url);
210
+ }
211
+ close() {}
212
+ },
213
+ );
214
+ using _network = vi.spyOn(globalThis, "fetch").mockImplementation(async (input, init) => {
215
+ const request = new Request(input, init);
216
+ if (request.url.endsWith("/api/voice/status"))
217
+ return Response.json({
218
+ ...status,
219
+ supportsStreaming: native,
220
+ supportsBufferedStreaming: buffered,
221
+ });
222
+ if (request.url.includes("/api/auth/websocket-ticket/"))
223
+ return Response.json({ ticket: "stream-ticket", expiresAt: "2030-01-01T00:00:00.000Z" });
224
+ throw new Error(`Unexpected request: ${request.url}`);
225
+ });
226
+ const abort = new AbortController();
227
+ using _abort = { [Symbol.dispose]: () => abort.abort() };
228
+ const platform = createBrowserVoiceInputPlatform({
229
+ prepared,
230
+ hasAudioConsent: () => true,
231
+ getStreamingEnabled: () => enabled,
232
+ getTranscriptionOptions: () => ({
233
+ ...DEFAULT_SPEECH_TRANSCRIPTION_OPTIONS,
234
+ speechTranslateToEnglish: true,
235
+ speechLanguage: "fr",
236
+ }),
237
+ getMicrophoneId: () => "",
238
+ onLevel() {},
239
+ onDurationLimit() {},
240
+ onText() {},
241
+ onError() {},
242
+ });
243
+ const transcription = await platform.transcriber.prepare({ signal: abort.signal });
244
+ expect(Boolean(transcription.streaming)).toBe(live);
245
+ expect(transcription.locale).toBe(native && enabled ? "fr" : "en");
246
+ expect(sockets).toEqual(
247
+ live ? ["wss://transcription.example.test/ws/voice?wsTicket=stream-ticket"] : [],
248
+ );
249
+ },
250
+);
apps/web/src/speech/browserVoiceInput.ts
+5
-4
@@ -27,6 +27,7 @@ export function createBrowserVoiceInputPlatform(input: {
27
readonly cloudModel?: CloudSpeechModelId | undefined;
28
readonly hasAudioConsent: () => boolean;
29
readonly getTranscriptionOptions: () => SpeechTranscriptionOptions;
30
+ readonly getStreamingEnabled: () => boolean;
31
readonly getMicrophoneId: () => string | Promise<string>;
32
readonly onLevel: (level: number) => void;
33
readonly onDurationLimit: () => void;
@@ -35,6 +36,7 @@ export function createBrowserVoiceInputPlatform(input: {
36
}) {
37
return createBrowserPcmCapture(input, async (options) => {
38
const recordingOptions = input.getTranscriptionOptions();
39
+ const streamingEnabled = input.getStreamingEnabled();
40
const transcribeRecording = async (
41
uri: string,
42
{ signal: transcriptionSignal }: VoiceTranscriptionOptions,
@@ -101,13 +103,12 @@ export function createBrowserVoiceInputPlatform(input: {
103
recordingOptions.speechLanguage,
104
)
105
: "auto";
106
+ const nativeStreaming = status.supportsStreaming && streamingEnabled;
107
const locale =
105
- !status.supportsStreaming &&
106
- status.supportsTranslation &&
107
- recordingOptions.speechTranslateToEnglish
108
+ !nativeStreaming && status.supportsTranslation && recordingOptions.speechTranslateToEnglish
109
? "en"
110
: language;
110
- if (!status.supportsStreaming && !status.supportsBufferedStreaming) {
111
+ if (status.supportsStreaming ? !nativeStreaming : !status.supportsBufferedStreaming) {
112
return { locale, transcribe: transcribeRecording };
113
}
114
const url = await runEnvironmentSpeech(getEnvironmentSpeechStreamUrl(input.prepared), options);
apps/web/src/speech/useEnvironmentSpeechInput.ts
+1
@@ -235,6 +235,7 @@ export function useEnvironmentSpeechInput(input: HookInput) {
235
cloudProvider,
236
cloudModel,
237
hasAudioConsent,
238
+ getStreamingEnabled: () => latestRef.current.clientSettings.speechStreaming,
239
getTranscriptionOptions: (): SpeechTranscriptionOptions => {
240
const {
241
clientSettings: settings,
docs/user/voice-input.md
+4
-1
@@ -73,7 +73,10 @@ language; speed is the time to transcribe 30 seconds on a reference GPU. Choose
73
**Auto**, a recording that fails on the GPU is retried once on that same
74
environment's CPU; a GPU you picked yourself reports the error instead. Nothing
75
is ever retried on another environment. Models marked **Live preview** show
76
-text while you speak. Other models can process long recordings in chunks at pauses
76
+text while you speak. On web and desktop, turn off **Advanced → Streaming transcription**
77
+to transcribe with the same model after stopping instead. This may help when live
78
+transcription falls behind. The preference is saved on this device and only applies
79
+to models that support native streaming. Other models can process long recordings in chunks at pauses
80
while you record; models with built-in long-form support transcribe when you stop.
81
82
## Dictate
packages/contracts/src/settings.test.ts
+5
@@ -516,6 +516,11 @@ describe("voice settings", () => {
516
speechPostProcessingEnabled: true,
517
};
518
expect(decodeClientSettings({}).speechSilenceFiltering).toBe(true);
519
+ expect(decodeClientSettings({}).speechStreaming).toBe(true);
520
+ expect(decodeClientSettings({ speechStreaming: false }).speechStreaming).toBe(false);
521
+ expect(decodeClientSettingsPatch({ speechStreaming: false })).toEqual({
522
+ speechStreaming: false,
523
+ });
524
expect(decodeClientSettingsPatch({ speechSilenceFiltering: false })).toEqual({
525
speechSilenceFiltering: false,
526
});
packages/contracts/src/settings.ts
+2
@@ -572,6 +572,7 @@ export const ClientSettingsSchema = Schema.Struct({
572
speechTranslateToEnglish: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
573
speechCustomWords: SpeechCustomWords.pipe(Schema.withDecodingDefault(Effect.succeed([]))),
574
speechSilenceFiltering: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
575
+ speechStreaming: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
576
speechRemoveFillerWords: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),
577
speechPostProcessingPrompt: SpeechPostProcessingPromptSettings.pipe(
578
Schema.withDecodingDefault(
@@ -2106,6 +2107,7 @@ export const ClientSettingsPatch = Schema.Struct({
2107
speechTranslateToEnglish: Schema.optionalKey(Schema.Boolean),
2108
speechCustomWords: Schema.optionalKey(SpeechCustomWords),
2109
speechSilenceFiltering: Schema.optionalKey(Schema.Boolean),
2110
+ speechStreaming: Schema.optionalKey(Schema.Boolean),
2111
speechRemoveFillerWords: Schema.optionalKey(Schema.Boolean),
2112
speechPostProcessingPrompt: Schema.optionalKey(SpeechPostProcessingPromptSettings),
2113
speechCorrectionWord: Schema.optionalKey(SpeechCorrectionCue),