UNPKG

@voice-ping/cognitive-services-speech

Version:

VoicePing Cognitive Services Speech SDK for JavaScript forked from Microsoft

78 lines (76 loc) 2.39 kB
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. /** * Defines result of speech synthesis. * @class SpeechSynthesisResult * Added in version 1.11.0 */ export class SpeechSynthesisResult { /** * Creates and initializes an instance of this class. * @constructor * @param {string} resultId - The result id. * @param {ResultReason} reason - The reason. * @param {number} audioData - The offset into the stream. * @param {string} errorDetails - Error details, if provided. * @param {PropertyCollection} properties - Additional properties, if provided. */ constructor(resultId, reason, audioData, errorDetails, properties) { this.privResultId = resultId; this.privReason = reason; this.privAudioData = audioData; this.privErrorDetails = errorDetails; this.privProperties = properties; } /** * Specifies the result identifier. * @member SpeechSynthesisResult.prototype.resultId * @function * @public * @returns {string} Specifies the result identifier. */ get resultId() { return this.privResultId; } /** * Specifies status of the result. * @member SpeechSynthesisResult.prototype.reason * @function * @public * @returns {ResultReason} Specifies status of the result. */ get reason() { return this.privReason; } /** * The synthesized audio data * @member SpeechSynthesisResult.prototype.audioData * @function * @public * @returns {ArrayBuffer} The synthesized audio data. */ get audioData() { return this.privAudioData; } /** * In case of an unsuccessful synthesis, provides details of the occurred error. * @member SpeechSynthesisResult.prototype.errorDetails * @function * @public * @returns {string} a brief description of an error. */ get errorDetails() { return this.privErrorDetails; } /** * The set of properties exposed in the result. * @member SpeechSynthesisResult.prototype.properties * @function * @public * @returns {PropertyCollection} The set of properties exposed in the result. */ get properties() { return this.privProperties; } } //# sourceMappingURL=SpeechSynthesisResult.js.map