mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
voice - log errors (#208983)
This commit is contained in:
parent
c3d8708d13
commit
b50ce76b2b
|
@ -4404,7 +4404,8 @@ export enum SpeechToTextStatus {
|
|||
Started = 1,
|
||||
Recognizing = 2,
|
||||
Recognized = 3,
|
||||
Stopped = 4
|
||||
Stopped = 4,
|
||||
Error = 5
|
||||
}
|
||||
|
||||
export enum KeywordRecognitionStatus {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}));
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@ export enum SpeechToTextStatus {
|
|||
Started = 1,
|
||||
Recognizing = 2,
|
||||
Recognized = 3,
|
||||
Stopped = 4
|
||||
Stopped = 4,
|
||||
Error = 5
|
||||
}
|
||||
|
||||
export interface ISpeechToTextEvent {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
3
src/vscode-dts/vscode.proposed.speech.d.ts
vendored
3
src/vscode-dts/vscode.proposed.speech.d.ts
vendored
|
@ -15,7 +15,8 @@ declare module 'vscode' {
|
|||
Started = 1,
|
||||
Recognizing = 2,
|
||||
Recognized = 3,
|
||||
Stopped = 4
|
||||
Stopped = 4,
|
||||
Error = 5
|
||||
}
|
||||
|
||||
export interface SpeechToTextEvent {
|
||||
|
|
Loading…
Reference in a new issue