@codingame/monaco-vscode-speech-service-override 4.5.2 → 5.0.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-speech-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@5.0.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -11,8 +11,6 @@ import { DeferredPromise } from 'vscode/vscode/vs/base/common/async';
|
|
|
11
11
|
import { HasSpeechProvider, SpeechToTextInProgress, speechLanguageConfigToLanguage, SPEECH_LANGUAGE_CONFIG, SpeechToTextStatus, KeywordRecognitionStatus } from 'vscode/vscode/vs/workbench/contrib/speech/common/speechService';
|
|
12
12
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
13
13
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
14
|
-
import { AccessibilitySignal } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
15
|
-
import { IAccessibilitySignalService } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
|
|
16
14
|
import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
|
|
17
15
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
18
16
|
|
|
@@ -42,14 +40,13 @@ const speechProvidersExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
|
|
|
42
40
|
});
|
|
43
41
|
let SpeechService = class SpeechService extends Disposable {
|
|
44
42
|
get hasSpeechProvider() { return this.providerDescriptors.size > 0 || this.providers.size > 0; }
|
|
45
|
-
constructor(logService, contextKeyService, hostService, telemetryService, configurationService,
|
|
43
|
+
constructor(logService, contextKeyService, hostService, telemetryService, configurationService, extensionService) {
|
|
46
44
|
super();
|
|
47
45
|
this.logService = logService;
|
|
48
46
|
this.contextKeyService = contextKeyService;
|
|
49
47
|
this.hostService = hostService;
|
|
50
48
|
this.telemetryService = telemetryService;
|
|
51
49
|
this.configurationService = configurationService;
|
|
52
|
-
this.accessibilitySignalService = accessibilitySignalService;
|
|
53
50
|
this.extensionService = extensionService;
|
|
54
51
|
this._onDidChangeHasSpeechProvider = this._register(( (new Emitter())));
|
|
55
52
|
this.onDidChangeHasSpeechProvider = this._onDidChangeHasSpeechProvider.event;
|
|
@@ -115,18 +112,19 @@ let SpeechService = class SpeechService extends Disposable {
|
|
|
115
112
|
const session = this._activeSpeechToTextSession = provider.createSpeechToTextSession(token, typeof language === 'string' ? { language } : undefined);
|
|
116
113
|
const sessionStart = Date.now();
|
|
117
114
|
let sessionRecognized = false;
|
|
115
|
+
let sessionError = false;
|
|
118
116
|
let sessionContentLength = 0;
|
|
119
117
|
const disposables = ( (new DisposableStore()));
|
|
120
118
|
const onSessionStoppedOrCanceled = () => {
|
|
121
119
|
if (session === this._activeSpeechToTextSession) {
|
|
122
120
|
this._activeSpeechToTextSession = undefined;
|
|
123
121
|
this.speechToTextInProgress.reset();
|
|
124
|
-
this.accessibilitySignalService.playSignal(AccessibilitySignal.voiceRecordingStopped, { allowManyInParallel: true });
|
|
125
122
|
this._onDidEndSpeechToTextSession.fire();
|
|
126
123
|
this.telemetryService.publicLog2('speechToTextSession', {
|
|
127
124
|
context,
|
|
128
125
|
sessionDuration: Date.now() - sessionStart,
|
|
129
126
|
sessionRecognized,
|
|
127
|
+
sessionError,
|
|
130
128
|
sessionContentLength,
|
|
131
129
|
sessionLanguage: language
|
|
132
130
|
});
|
|
@@ -143,7 +141,6 @@ let SpeechService = class SpeechService extends Disposable {
|
|
|
143
141
|
if (session === this._activeSpeechToTextSession) {
|
|
144
142
|
this.speechToTextInProgress.set(true);
|
|
145
143
|
this._onDidStartSpeechToTextSession.fire();
|
|
146
|
-
this.accessibilitySignalService.playSignal(AccessibilitySignal.voiceRecordingStarted);
|
|
147
144
|
}
|
|
148
145
|
break;
|
|
149
146
|
case SpeechToTextStatus.Recognizing:
|
|
@@ -157,6 +154,10 @@ let SpeechService = class SpeechService extends Disposable {
|
|
|
157
154
|
case SpeechToTextStatus.Stopped:
|
|
158
155
|
onSessionStoppedOrCanceled();
|
|
159
156
|
break;
|
|
157
|
+
case SpeechToTextStatus.Error:
|
|
158
|
+
this.logService.error(`Speech provider error in speech to text session: ${e.text}`);
|
|
159
|
+
sessionError = true;
|
|
160
|
+
break;
|
|
160
161
|
}
|
|
161
162
|
}));
|
|
162
163
|
return session;
|
|
@@ -256,8 +257,7 @@ SpeechService = ( (__decorate([
|
|
|
256
257
|
( (__param(2, IHostService))),
|
|
257
258
|
( (__param(3, ITelemetryService))),
|
|
258
259
|
( (__param(4, IConfigurationService))),
|
|
259
|
-
( (__param(5,
|
|
260
|
-
( (__param(6, IExtensionService)))
|
|
260
|
+
( (__param(5, IExtensionService)))
|
|
261
261
|
], SpeechService)));
|
|
262
262
|
|
|
263
263
|
export { SpeechService };
|