@voice-ping/cognitive-services-speech
Version:
VoicePing Cognitive Services Speech SDK for JavaScript forked from Microsoft
28 lines (26 loc) • 908 B
JavaScript
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
export class SpeechHypothesis {
constructor(json) {
this.privSpeechHypothesis = JSON.parse(json);
}
static fromJSON(json) {
return new SpeechHypothesis(json);
}
get Text() {
return this.privSpeechHypothesis.Text;
}
get Offset() {
return this.privSpeechHypothesis.Offset;
}
get Duration() {
return this.privSpeechHypothesis.Duration;
}
get Language() {
return this.privSpeechHypothesis.PrimaryLanguage === undefined ? undefined : this.privSpeechHypothesis.PrimaryLanguage.Language;
}
get LanguageDetectionConfidence() {
return this.privSpeechHypothesis.PrimaryLanguage === undefined ? undefined : this.privSpeechHypothesis.PrimaryLanguage.Confidence;
}
}
//# sourceMappingURL=SpeechHypothesis.js.map