1 |
- {"ast":null,"code":"\"use strict\";\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.EnumTranslation = void 0;\nconst Exports_js_1 = require(\"../sdk/Exports.js\");\nconst Exports_js_2 = require(\"./Exports.js\");\nclass EnumTranslation {\n static implTranslateRecognitionResult(recognitionStatus, expectEndOfDictation = false) {\n let reason = Exports_js_1.ResultReason.Canceled;\n switch (recognitionStatus) {\n case Exports_js_2.RecognitionStatus.Success:\n reason = Exports_js_1.ResultReason.RecognizedSpeech;\n break;\n case Exports_js_2.RecognitionStatus.EndOfDictation:\n // If we need the result in EndOfDictation (typically some session level result),\n // translate into RecognizedSpeech, otherwise NoMatch\n reason = expectEndOfDictation ? Exports_js_1.ResultReason.RecognizedSpeech : Exports_js_1.ResultReason.NoMatch;\n break;\n case Exports_js_2.RecognitionStatus.NoMatch:\n case Exports_js_2.RecognitionStatus.InitialSilenceTimeout:\n case Exports_js_2.RecognitionStatus.BabbleTimeout:\n reason = Exports_js_1.ResultReason.NoMatch;\n break;\n case Exports_js_2.RecognitionStatus.Error:\n case Exports_js_2.RecognitionStatus.BadRequest:\n case Exports_js_2.RecognitionStatus.Forbidden:\n default:\n reason = Exports_js_1.ResultReason.Canceled;\n break;\n }\n return reason;\n }\n static implTranslateCancelResult(recognitionStatus) {\n let reason = Exports_js_1.CancellationReason.EndOfStream;\n switch (recognitionStatus) {\n case Exports_js_2.RecognitionStatus.Success:\n case Exports_js_2.RecognitionStatus.EndOfDictation:\n case Exports_js_2.RecognitionStatus.NoMatch:\n reason = Exports_js_1.CancellationReason.EndOfStream;\n break;\n case Exports_js_2.RecognitionStatus.InitialSilenceTimeout:\n case Exports_js_2.RecognitionStatus.BabbleTimeout:\n case Exports_js_2.RecognitionStatus.Error:\n case Exports_js_2.RecognitionStatus.BadRequest:\n case Exports_js_2.RecognitionStatus.Forbidden:\n default:\n reason = Exports_js_1.CancellationReason.Error;\n break;\n }\n return reason;\n }\n static implTranslateCancelErrorCode(recognitionStatus) {\n let reason = Exports_js_1.CancellationErrorCode.NoError;\n switch (recognitionStatus) {\n case Exports_js_2.RecognitionStatus.Error:\n reason = Exports_js_1.CancellationErrorCode.ServiceError;\n break;\n case Exports_js_2.RecognitionStatus.TooManyRequests:\n reason = Exports_js_1.CancellationErrorCode.TooManyRequests;\n break;\n case Exports_js_2.RecognitionStatus.BadRequest:\n reason = Exports_js_1.CancellationErrorCode.BadRequestParameters;\n break;\n case Exports_js_2.RecognitionStatus.Forbidden:\n reason = Exports_js_1.CancellationErrorCode.Forbidden;\n break;\n default:\n reason = Exports_js_1.CancellationErrorCode.NoError;\n break;\n }\n return reason;\n }\n static implTranslateErrorDetails(cancellationErrorCode) {\n let errorDetails = \"The speech service encountered an internal error and could not continue.\";\n switch (cancellationErrorCode) {\n case Exports_js_1.CancellationErrorCode.Forbidden:\n errorDetails = \"The recognizer is using a free subscription that ran out of quota.\";\n break;\n case Exports_js_1.CancellationErrorCode.BadRequestParameters:\n errorDetails = \"Invalid parameter or unsupported audio format in the request.\";\n break;\n case Exports_js_1.CancellationErrorCode.TooManyRequests:\n errorDetails = \"The number of parallel requests exceeded the number of allowed concurrent transcriptions.\";\n break;\n default:\n break;\n }\n return errorDetails;\n }\n}\nexports.EnumTranslation = EnumTranslation;","map":{"version":3,"names":["Object","defineProperty","exports","value","EnumTranslation","Exports_js_1","require","Exports_js_2","implTranslateRecognitionResult","recognitionStatus","expectEndOfDictation","reason","ResultReason","Canceled","RecognitionStatus","Success","RecognizedSpeech","EndOfDictation","NoMatch","InitialSilenceTimeout","BabbleTimeout","Error","BadRequest","Forbidden","implTranslateCancelResult","CancellationReason","EndOfStream","implTranslateCancelErrorCode","CancellationErrorCode","NoError","ServiceError","TooManyRequests","BadRequestParameters","implTranslateErrorDetails","cancellationErrorCode","errorDetails"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common.speech/EnumTranslation.js"],"sourcesContent":["\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EnumTranslation = void 0;\nconst Exports_js_1 = require(\"../sdk/Exports.js\");\nconst Exports_js_2 = require(\"./Exports.js\");\nclass EnumTranslation {\n static implTranslateRecognitionResult(recognitionStatus, expectEndOfDictation = false) {\n let reason = Exports_js_1.ResultReason.Canceled;\n switch (recognitionStatus) {\n case Exports_js_2.RecognitionStatus.Success:\n reason = Exports_js_1.ResultReason.RecognizedSpeech;\n break;\n case Exports_js_2.RecognitionStatus.EndOfDictation:\n // If we need the result in EndOfDictation (typically some session level result),\n // translate into RecognizedSpeech, otherwise NoMatch\n reason = expectEndOfDictation ? Exports_js_1.ResultReason.RecognizedSpeech : Exports_js_1.ResultReason.NoMatch;\n break;\n case Exports_js_2.RecognitionStatus.NoMatch:\n case Exports_js_2.RecognitionStatus.InitialSilenceTimeout:\n case Exports_js_2.RecognitionStatus.BabbleTimeout:\n reason = Exports_js_1.ResultReason.NoMatch;\n break;\n case Exports_js_2.RecognitionStatus.Error:\n case Exports_js_2.RecognitionStatus.BadRequest:\n case Exports_js_2.RecognitionStatus.Forbidden:\n default:\n reason = Exports_js_1.ResultReason.Canceled;\n break;\n }\n return reason;\n }\n static implTranslateCancelResult(recognitionStatus) {\n let reason = Exports_js_1.CancellationReason.EndOfStream;\n switch (recognitionStatus) {\n case Exports_js_2.RecognitionStatus.Success:\n case Exports_js_2.RecognitionStatus.EndOfDictation:\n case Exports_js_2.RecognitionStatus.NoMatch:\n reason = Exports_js_1.CancellationReason.EndOfStream;\n break;\n case Exports_js_2.RecognitionStatus.InitialSilenceTimeout:\n case Exports_js_2.RecognitionStatus.BabbleTimeout:\n case Exports_js_2.RecognitionStatus.Error:\n case Exports_js_2.RecognitionStatus.BadRequest:\n case Exports_js_2.RecognitionStatus.Forbidden:\n default:\n reason = Exports_js_1.CancellationReason.Error;\n break;\n }\n return reason;\n }\n static implTranslateCancelErrorCode(recognitionStatus) {\n let reason = Exports_js_1.CancellationErrorCode.NoError;\n switch (recognitionStatus) {\n case Exports_js_2.RecognitionStatus.Error:\n reason = Exports_js_1.CancellationErrorCode.ServiceError;\n break;\n case Exports_js_2.RecognitionStatus.TooManyRequests:\n reason = Exports_js_1.CancellationErrorCode.TooManyRequests;\n break;\n case Exports_js_2.RecognitionStatus.BadRequest:\n reason = Exports_js_1.CancellationErrorCode.BadRequestParameters;\n break;\n case Exports_js_2.RecognitionStatus.Forbidden:\n reason = Exports_js_1.CancellationErrorCode.Forbidden;\n break;\n default:\n reason = Exports_js_1.CancellationErrorCode.NoError;\n break;\n }\n return reason;\n }\n static implTranslateErrorDetails(cancellationErrorCode) {\n let errorDetails = \"The speech service encountered an internal error and could not continue.\";\n switch (cancellationErrorCode) {\n case Exports_js_1.CancellationErrorCode.Forbidden:\n errorDetails = \"The recognizer is using a free subscription that ran out of quota.\";\n break;\n case Exports_js_1.CancellationErrorCode.BadRequestParameters:\n errorDetails = \"Invalid parameter or unsupported audio format in the request.\";\n break;\n case Exports_js_1.CancellationErrorCode.TooManyRequests:\n errorDetails = \"The number of parallel requests exceeded the number of allowed concurrent transcriptions.\";\n break;\n default:\n break;\n }\n return errorDetails;\n }\n}\nexports.EnumTranslation = EnumTranslation;\n\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACAA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7DD,OAAO,CAACE,eAAe,GAAG,KAAK,CAAC;AAChC,MAAMC,YAAY,GAAGC,OAAO,CAAC,mBAAmB,CAAC;AACjD,MAAMC,YAAY,GAAGD,OAAO,CAAC,cAAc,CAAC;AAC5C,MAAMF,eAAe,CAAC;EAClB,OAAOI,8BAA8BA,CAACC,iBAAiB,EAAEC,oBAAoB,GAAG,KAAK,EAAE;IACnF,IAAIC,MAAM,G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