diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index e8faf7df453..ce901a21850 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -4404,7 +4404,8 @@ export enum SpeechToTextStatus { Started = 1, Recognizing = 2, Recognized = 3, - Stopped = 4 + Stopped = 4, + Error = 5 } export enum KeywordRecognitionStatus { diff --git a/src/vs/workbench/contrib/speech/browser/speechService.ts b/src/vs/workbench/contrib/speech/browser/speechService.ts index 4d13c101203..a5806498969 100644 --- a/src/vs/workbench/contrib/speech/browser/speechService.ts +++ b/src/vs/workbench/contrib/speech/browser/speechService.ts @@ -147,6 +147,7 @@ export class SpeechService extends Disposable implements ISpeechService { const sessionStart = Date.now(); let sessionRecognized = false; + let sessionError = false; let sessionContentLength = 0; const disposables = new DisposableStore(); @@ -164,6 +165,7 @@ export class SpeechService extends Disposable implements ISpeechService { context: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Context of the session.' }; sessionDuration: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'Duration of the session.' }; sessionRecognized: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'If speech was recognized.' }; + sessionError: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'If speech resulted in error.' }; sessionContentLength: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; isMeasurement: true; comment: 'Length of the recognized text.' }; sessionLanguage: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Configured language for the session.' }; }; @@ -171,6 +173,7 @@ export class SpeechService extends Disposable implements ISpeechService { context: string; sessionDuration: number; sessionRecognized: boolean; + sessionError: boolean; sessionContentLength: number; sessionLanguage: string; }; @@ -178,6 +181,7 @@ export class SpeechService extends Disposable implements ISpeechService { context, sessionDuration: Date.now() - sessionStart, sessionRecognized, + sessionError, sessionContentLength, sessionLanguage: language }); @@ -211,6 +215,10 @@ export class SpeechService extends Disposable implements ISpeechService { case SpeechToTextStatus.Stopped: onSessionStoppedOrCanceled(); break; + case SpeechToTextStatus.Error: + this.logService.error(`Speech provider error in speech to text session: ${e.text}`); + sessionError = true; + break; } })); diff --git a/src/vs/workbench/contrib/speech/common/speechService.ts b/src/vs/workbench/contrib/speech/common/speechService.ts index 6aced99f16e..4f260469983 100644 --- a/src/vs/workbench/contrib/speech/common/speechService.ts +++ b/src/vs/workbench/contrib/speech/common/speechService.ts @@ -26,7 +26,8 @@ export enum SpeechToTextStatus { Started = 1, Recognizing = 2, Recognized = 3, - Stopped = 4 + Stopped = 4, + Error = 5 } export interface ISpeechToTextEvent { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalVoice.ts b/src/vs/workbench/contrib/terminal/browser/terminalVoice.ts index a22ec3f5ddd..042cd3de2ab 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalVoice.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalVoice.ts @@ -97,7 +97,6 @@ export class TerminalVoiceSession extends Disposable { } switch (e.status) { case SpeechToTextStatus.Started: - // TODO: play start audio cue if (!this._decoration) { this._createDecoration(); } @@ -117,7 +116,6 @@ export class TerminalVoiceSession extends Disposable { } break; case SpeechToTextStatus.Stopped: - // TODO: play stop audio cue this.stop(); break; } diff --git a/src/vscode-dts/vscode.proposed.speech.d.ts b/src/vscode-dts/vscode.proposed.speech.d.ts index 091c3995af3..9ece68528b9 100644 --- a/src/vscode-dts/vscode.proposed.speech.d.ts +++ b/src/vscode-dts/vscode.proposed.speech.d.ts @@ -15,7 +15,8 @@ declare module 'vscode' { Started = 1, Recognizing = 2, Recognized = 3, - Stopped = 4 + Stopped = 4, + Error = 5 } export interface SpeechToTextEvent {