speechService.ts ×1

Frontier kind: Code frontier

unlabeled · c_75d81f2aacc6

4 tests · 6376 LOC · 30 files · introduces 0 tests · 228 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
1 range228 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1010 ranges6376 lines · 30 files · Browse complete extent
All tests (intent)
4 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Introduced files, introduced tests, and structurally relevant concept specializationvoiceChatService.ts ×1 · 1 introduced LOCvoiceChatService.ts ×1voiceChatService.ts ×4 · 18 introduced LOCvoiceChatService.ts ×4voiceChatService.ts ×4 · 25 introduced LOCvoiceChatService.ts ×4voiceChatService.ts ×11 · 202 introduced LOCvoiceChatService.ts ×11speechService.ts ×1 · 16 introduced LOCspeechService.ts ×1contextkey.ts ×1 · 1 introduced LOCcontextkey.ts ×1contextkey.ts ×3 · 7 introduced LOCcontextkey.ts ×3contextkey.ts ×1 · 2 introduced LOCcontextkey.ts ×1contextkey.ts ×2 · 3 introduced LOCcontextkey.ts ×2contextkey.ts ×2 · 3 introduced LOCcontextkey.ts ×2contextkey.ts ×1 · 2 introduced LOCcontextkey.ts ×1contextkey.ts ×1 · 4 introduced LOCcontextkey.ts ×1contextkey.ts ×201 · 796 introduced LOCcontextkey.ts ×201strings.test|title=Strings trimWhitespace|occurrence=1 · 0 introduced LOCstrings.test|title=Strin…strings.ts ×101 · 542 introduced LOCstrings.ts ×101cancellation.test|title=CancellationToken None|occurrence=1 · 0 introduced LOCcancellation.test|title=…cancellation.ts ×18 · 90 introduced LOCcancellation.ts ×18event.ts ×93 · 864 introduced LOCevent.ts ×93scanner.ts ×13 · 13 introduced LOCscanner.ts ×13scanner.ts ×3 · 3 introduced LOCscanner.ts ×3scanner.ts ×1 · 1 introduced LOCscanner.ts ×1scanner.ts ×1 · 1 introduced LOCscanner.ts ×1scanner.ts ×1 · 1 introduced LOCscanner.ts ×1scanner.ts ×1 · 1 introduced LOCscanner.ts ×1scanner.ts ×1 · 1 introduced LOCscanner.ts ×1scanner.ts ×1 · 1 introduced LOCscanner.ts ×1scanner.ts ×36 · 181 introduced LOCscanner.ts ×36uri.test|title=URI URI#file, win-speciale|occurrence=1, charCode.test|title=CharCode has good values|occurrence=1, +2 · 0 introduced LOCuri.test|title=URI URI#f…utils.ts ×3 · 9 introduced LOCutils.ts ×3nls.ts ×1 · 1 introduced LOCnls.ts ×1linkedList.ts ×13 · 44 introduced LOClinkedList.ts ×13nls.ts ×6 · 13 introduced LOCnls.ts ×6instantiation.ts ×5 · 111 introduced LOCinstantiation.ts ×5lifecycle.ts ×2 · 4 introduced LOClifecycle.ts ×2lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×4 · 8 introduced LOClifecycle.ts ×4lifecycle.ts ×6 · 16 introduced LOClifecycle.ts ×6lazy.ts ×1 · 2 introduced LOClazy.ts ×1lazy.ts ×3 · 37 introduced LOClazy.ts ×3lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1uint.ts ×2 · 43 introduced LOCuint.ts ×2lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1map.ts ×97 · 3334 introduced LOCmap.ts ×97src/vs/base/common/arrays.ts · 949 LOCcommon/arrays.tssrc/vs/base/common/arraysFind.ts · 226 LOCcommon/arraysFind.tssrc/vs/base/common/assert.ts · 91 LOCcommon/assert.tssrc/vs/base/common/cache.ts · 153 LOCcommon/cache.tssrc/vs/base/common/cancellation.ts · 206 LOCcommon/cancellation.tssrc/vs/base/common/charCode.ts · 450 LOCcommon/charCode.tssrc/vs/base/common/collections.ts · 176 LOCcommon/collections.tssrc/vs/base/common/errors.ts · 357 LOCcommon/errors.tssrc/vs/base/common/event.ts · 1964 LOCcommon/event.tssrc/vs/base/common/functional.ts · 32 LOCcommon/functional.tssrc/vs/base/common/iterator.ts · 194 LOCcommon/iterator.tssrc/vs/base/common/lazy.ts · 57 LOCcommon/lazy.tssrc/vs/base/common/lifecycle.ts · 974 LOCcommon/lifecycle.tssrc/vs/base/common/linkedList.ts · 151 LOCcommon/linkedList.tssrc/vs/base/common/map.ts · 1016 LOCcommon/map.tssrc/vs/base/common/marshallingIds.ts · 33 LOCcommon/marshallingIds.tssrc/vs/base/common/path.ts · 1589 LOCcommon/path.tssrc/vs/base/common/platform.ts · 281 LOCcommon/platform.tssrc/vs/base/common/process.ts · 76 LOCcommon/process.tssrc/vs/base/common/stopwatch.ts · 41 LOCcommon/stopwatch.tssrc/vs/base/common/strings.ts · 1413 LOCcommon/strings.tssrc/vs/base/common/types.ts · 410 LOCcommon/types.tssrc/vs/base/common/uint.ts · 59 LOCcommon/uint.tssrc/vs/base/common/uri.ts · 754 LOCcommon/uri.tssrc/vs/base/test/common/utils.ts · 107 LOCcommon/utils.tssrc/vs/nls.ts · 244 LOCvs/nls.tssrc/vs/platform/contextkey/common/contextkey.ts · 2183 LOCcommon/contextkey.tssrc/vs/platform/contextkey/common/scanner.ts · 384 LOCcommon/scanner.tssrc/vs/platform/instantiation/common/instantiation.ts · 130 LOCcommon/instantiation.tssrc/vs/platform/keybinding/test/common/mockKeybindingService.ts · 178 LOCcommon/mockKeybindingSer…src/vs/workbench/contrib/chat/common/voiceChatService.ts · 251 LOCcommon/voiceChatService.…src/vs/workbench/contrib/speech/common/speechService.ts · 244 LOCcommon/speechService.tscancellation.test|title=CancellationToken None|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/cancellation.test|title=CancellationToken None|occurrence=1cancellation.test|title=…charCode.test|title=CharCode has good values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1charCode.test|title=Char…path.test|title=Paths (Node Implementation) path|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1path.test|title=Paths (N…strings.test|title=Strings trimWhitespace|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/strings.test|title=Strings trimWhitespace|occurrence=1strings.test|title=Strin…uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1uri.test|title=URI File …uri.test|title=URI URI#file, win-speciale|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1uri.test|title=URI URI#f…voiceChatService.test|title=VoiceChat Agent and slash command detection (useAgents: false)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/voiceChatService.test|title=VoiceChat Agent and slash command detection (useAgents: false)|occurrence=1voiceChatService.test|ti…voiceChatService.test|title=VoiceChat Agent and slash command detection (useAgents: true)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/voiceChatService.test|title=VoiceChat Agent and slash command detection (useAgents: true)|occurrence=1voiceChatService.test|ti…voiceChatService.test|title=VoiceChat waiting for input|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/voiceChatService.test|title=VoiceChat waiting for input|occurrence=1voiceChatService.test|ti…speechService.test|title=SpeechService resolve language|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/speech/test/common/speechService.test|title=SpeechService resolve language|occurrence=1speechService.test|title…Focused concept · speechService.ts ×1 · 228 introduced LOCspeechService.ts ×1

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 228 introduced LOC across 1 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/speech/common/speechService.ts 228 introduced LOC · 1 range

Open complete file

1 > /*--------------------------------------------------------------------------------------------- speechService.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { localize } from '../../../../nls.js';
7 > import { CancellationToken } from '../../../../base/common/cancellation.js';
8 > import { Event } from '../../../../base/common/event.js';
9 > import { IDisposable } from '../../../../base/common/lifecycle.js';
10 > import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
11 > import { ExtensionIdentifier } from '../../../../platform/extensions/common/extensions.js';
12 > import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';
13 > import { language } from '../../../../base/common/platform.js';
14 >
15 > export const ISpeechService = createDecorator<ISpeechService>('speechService');
16 >
17 > export const HasSpeechProvider = new RawContextKey<boolean>('hasSpeechProvider', false, { type: 'boolean', description: localize('hasSpeechProvider', "A speech provider is registered to the speech service.") });
18 > export const SpeechToTextInProgress = new RawContextKey<boolean>('speechToTextInProgress', false, { type: 'boolean', description: localize('speechToTextInProgress', "A speech-to-text session is in progress.") });
19 > export const TextToSpeechInProgress = new RawContextKey<boolean>('textToSpeechInProgress', false, { type: 'boolean', description: localize('textToSpeechInProgress', "A text-to-speech session is in progress.") });
20 >
21 > export interface ISpeechProviderMetadata {
22 > readonly extension: ExtensionIdentifier;
23 > readonly displayName: string;
24 > }
25 >
26 > export enum SpeechToTextStatus {
27 > Started = 1,
28 > Recognizing = 2,
29 > Recognized = 3,
30 > Stopped = 4,
31 > Error = 5
32 > }
33 >
34 > export interface ISpeechToTextEvent {
35 > readonly status: SpeechToTextStatus;
36 > readonly text?: string;
37 > }
38 >
39 > export interface ISpeechToTextSession {
40 > readonly onDidChange: Event<ISpeechToTextEvent>;
41 > }
42 >
43 > export enum TextToSpeechStatus {
44 > Started = 1,
45 > Stopped = 2,
46 > Error = 3
47 > }
48 >
49 > export interface ITextToSpeechEvent {
50 > readonly status: TextToSpeechStatus;
51 > readonly text?: string;
52 > }
53 >
54 > export interface ITextToSpeechSession {
55 > readonly onDidChange: Event<ITextToSpeechEvent>;
56 >
57 > synthesize(text: string): Promise<void>;
58 > }
59 >
60 > export enum KeywordRecognitionStatus {
61 > Recognized = 1,
62 > Stopped = 2,
63 > Canceled = 3
64 > }
65 >
66 > export interface IKeywordRecognitionEvent {
67 > readonly status: KeywordRecognitionStatus;
68 > readonly text?: string;
69 > }
70 >
71 > export interface IKeywordRecognitionSession {
72 > readonly onDidChange: Event<IKeywordRecognitionEvent>;
73 > }
74 >
75 > export interface ISpeechToTextSessionOptions {
76 > readonly language?: string;
77 > }
78 >
79 > export interface ITextToSpeechSessionOptions {
80 > readonly language?: string;
81 > }
82 >
83 > export interface ISpeechProvider {
84 > readonly metadata: ISpeechProviderMetadata;
85 >
86 > createSpeechToTextSession(token: CancellationToken, options?: ISpeechToTextSessionOptions): ISpeechToTextSession;
87 > createTextToSpeechSession(token: CancellationToken, options?: ITextToSpeechSessionOptions): ITextToSpeechSession;
88 > createKeywordRecognitionSession(token: CancellationToken): IKeywordRecognitionSession;
89 > }
90 >
91 > export interface ISpeechService {
92 >
93 > readonly _serviceBrand: undefined;
94 >
95 > readonly onDidChangeHasSpeechProvider: Event<void>;
96 >
97 > readonly hasSpeechProvider: boolean;
98 >
99 > registerSpeechProvider(identifier: string, provider: ISpeechProvider): IDisposable;
100 >
101 > readonly onDidStartSpeechToTextSession: Event<void>;
102 > readonly onDidEndSpeechToTextSession: Event<void>;
103 >
104 > readonly hasActiveSpeechToTextSession: boolean;
105 >
106 > /**
107 > * Starts to transcribe speech from the default microphone. The returned
108 > * session object provides an event to subscribe for transcribed text.
109 > */
110 > createSpeechToTextSession(token: CancellationToken, context?: string): Promise<ISpeechToTextSession>;
111 >
112 > readonly onDidStartTextToSpeechSession: Event<void>;
113 > readonly onDidEndTextToSpeechSession: Event<void>;
114 >
115 > readonly hasActiveTextToSpeechSession: boolean;
116 >
117 > /**
118 > * Creates a synthesizer to synthesize speech from text. The returned
119 > * session object provides a method to synthesize text and listen for
120 > * events.
121 > */
122 > createTextToSpeechSession(token: CancellationToken, context?: string): Promise<ITextToSpeechSession>;
123 >
124 > readonly onDidStartKeywordRecognition: Event<void>;
125 > readonly onDidEndKeywordRecognition: Event<void>;
126 >
127 > readonly hasActiveKeywordRecognition: boolean;
128 >
129 > /**
130 > * Starts to recognize a keyword from the default microphone. The returned
131 > * status indicates if the keyword was recognized or if the session was
132 > * stopped.
133 > */
134 > recognizeKeyword(token: CancellationToken): Promise<KeywordRecognitionStatus>;
135 > }
136 >
137 > export const enum AccessibilityVoiceSettingId {
138 > SpeechTimeout = 'accessibility.voice.speechTimeout',
139 > AutoSynthesize = 'accessibility.voice.autoSynthesize',
140 > SpeechLanguage = 'accessibility.voice.speechLanguage',
141 > IgnoreCodeBlocks = 'accessibility.voice.ignoreCodeBlocks'
142 > }
143 >
144 > export const SPEECH_LANGUAGE_CONFIG = AccessibilityVoiceSettingId.SpeechLanguage;
145 >
146 > export const SPEECH_LANGUAGES = {
147 > ['da-DK']: {
148 > name: localize('speechLanguage.da-DK', "Danish (Denmark)")
149 > },
150 > ['de-DE']: {
151 > name: localize('speechLanguage.de-DE', "German (Germany)")
152 > },
153 > ['en-AU']: {
154 > name: localize('speechLanguage.en-AU', "English (Australia)")
155 > },
156 > ['en-CA']: {
157 > name: localize('speechLanguage.en-CA', "English (Canada)")
158 > },
159 > ['en-GB']: {
160 > name: localize('speechLanguage.en-GB', "English (United Kingdom)")
161 > },
162 > ['en-IE']: {
163 > name: localize('speechLanguage.en-IE', "English (Ireland)")
164 > },
165 > ['en-IN']: {
166 > name: localize('speechLanguage.en-IN', "English (India)")
167 > },
168 > ['en-NZ']: {
169 > name: localize('speechLanguage.en-NZ', "English (New Zealand)")
170 > },
171 > ['en-US']: {
172 > name: localize('speechLanguage.en-US', "English (United States)")
173 > },
174 > ['es-ES']: {
175 > name: localize('speechLanguage.es-ES', "Spanish (Spain)")
176 > },
177 > ['es-MX']: {
178 > name: localize('speechLanguage.es-MX', "Spanish (Mexico)")
179 > },
180 > ['fr-CA']: {
181 > name: localize('speechLanguage.fr-CA', "French (Canada)")
182 > },
183 > ['fr-FR']: {
184 > name: localize('speechLanguage.fr-FR', "French (France)")
185 > },
186 > ['hi-IN']: {
187 > name: localize('speechLanguage.hi-IN', "Hindi (India)")
188 > },
189 > ['it-IT']: {
190 > name: localize('speechLanguage.it-IT', "Italian (Italy)")
191 > },
192 > ['ja-JP']: {
193 > name: localize('speechLanguage.ja-JP', "Japanese (Japan)")
194 > },
195 > ['ko-KR']: {
196 > name: localize('speechLanguage.ko-KR', "Korean (South Korea)")
197 > },
198 > ['nl-NL']: {
199 > name: localize('speechLanguage.nl-NL', "Dutch (Netherlands)")
200 > },
201 > ['pt-PT']: {
202 > name: localize('speechLanguage.pt-PT', "Portuguese (Portugal)")
203 > },
204 > ['pt-BR']: {
205 > name: localize('speechLanguage.pt-BR', "Portuguese (Brazil)")
206 > },
207 > ['ru-RU']: {
208 > name: localize('speechLanguage.ru-RU', "Russian (Russia)")
209 > },
210 > ['sv-SE']: {
211 > name: localize('speechLanguage.sv-SE', "Swedish (Sweden)")
212 > },
213 > ['tr-TR']: {
214 > // allow-any-unicode-next-line
215 > name: localize('speechLanguage.tr-TR', "Turkish (Türkiye)")
216 > },
217 > ['zh-CN']: {
218 > name: localize('speechLanguage.zh-CN', "Chinese (Simplified, China)")
219 > },
220 > ['zh-HK']: {
221 > name: localize('speechLanguage.zh-HK', "Chinese (Traditional, Hong Kong)")
222 > },
223 > ['zh-TW']: {
224 > name: localize('speechLanguage.zh-TW', "Chinese (Traditional, Taiwan)")
225 > }
226 > };
227 >
228 > export function speechLanguageConfigToLanguage(config: unknown, lang = language): string {
229 if (typeof config === 'string') {
230 if (config === 'auto') {