4852bde575a42709294dd640290ed7f67312205c5a3f1b9c0c0f5ba441a718f4.json 15 KB

1
  1. {"ast":null,"code":"\"use strict\";\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n/* eslint-disable max-classes-per-file */\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.RecognitionEndedEvent = exports.RecognitionCompletionStatus = exports.RecognitionStartedEvent = exports.ConnectingToServiceEvent = exports.ListeningStartedEvent = exports.RecognitionTriggeredEvent = exports.SpeechRecognitionEvent = void 0;\nconst Exports_js_1 = require(\"../common/Exports.js\");\nclass SpeechRecognitionEvent extends Exports_js_1.PlatformEvent {\n constructor(eventName, requestId, sessionId, eventType = Exports_js_1.EventType.Info) {\n super(eventName, eventType);\n this.privRequestId = requestId;\n this.privSessionId = sessionId;\n }\n get requestId() {\n return this.privRequestId;\n }\n get sessionId() {\n return this.privSessionId;\n }\n}\nexports.SpeechRecognitionEvent = SpeechRecognitionEvent;\nclass RecognitionTriggeredEvent extends SpeechRecognitionEvent {\n constructor(requestId, sessionId, audioSourceId, audioNodeId) {\n super(\"RecognitionTriggeredEvent\", requestId, sessionId);\n this.privAudioSourceId = audioSourceId;\n this.privAudioNodeId = audioNodeId;\n }\n get audioSourceId() {\n return this.privAudioSourceId;\n }\n get audioNodeId() {\n return this.privAudioNodeId;\n }\n}\nexports.RecognitionTriggeredEvent = RecognitionTriggeredEvent;\nclass ListeningStartedEvent extends SpeechRecognitionEvent {\n constructor(requestId, sessionId, audioSourceId, audioNodeId) {\n super(\"ListeningStartedEvent\", requestId, sessionId);\n this.privAudioSourceId = audioSourceId;\n this.privAudioNodeId = audioNodeId;\n }\n get audioSourceId() {\n return this.privAudioSourceId;\n }\n get audioNodeId() {\n return this.privAudioNodeId;\n }\n}\nexports.ListeningStartedEvent = ListeningStartedEvent;\nclass ConnectingToServiceEvent extends SpeechRecognitionEvent {\n constructor(requestId, authFetchEventid, sessionId) {\n super(\"ConnectingToServiceEvent\", requestId, sessionId);\n this.privAuthFetchEventid = authFetchEventid;\n }\n get authFetchEventid() {\n return this.privAuthFetchEventid;\n }\n}\nexports.ConnectingToServiceEvent = ConnectingToServiceEvent;\nclass RecognitionStartedEvent extends SpeechRecognitionEvent {\n constructor(requestId, audioSourceId, audioNodeId, authFetchEventId, sessionId) {\n super(\"RecognitionStartedEvent\", requestId, sessionId);\n this.privAudioSourceId = audioSourceId;\n this.privAudioNodeId = audioNodeId;\n this.privAuthFetchEventId = authFetchEventId;\n }\n get audioSourceId() {\n return this.privAudioSourceId;\n }\n get audioNodeId() {\n return this.privAudioNodeId;\n }\n get authFetchEventId() {\n return this.privAuthFetchEventId;\n }\n}\nexports.RecognitionStartedEvent = RecognitionStartedEvent;\nvar RecognitionCompletionStatus;\n(function (RecognitionCompletionStatus) {\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"Success\"] = 0] = \"Success\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"AudioSourceError\"] = 1] = \"AudioSourceError\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"AudioSourceTimeout\"] = 2] = \"AudioSourceTimeout\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"AuthTokenFetchError\"] = 3] = \"AuthTokenFetchError\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"AuthTokenFetchTimeout\"] = 4] = \"AuthTokenFetchTimeout\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"UnAuthorized\"] = 5] = \"UnAuthorized\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"ConnectTimeout\"] = 6] = \"ConnectTimeout\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"ConnectError\"] = 7] = \"ConnectError\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"ClientRecognitionActivityTimeout\"] = 8] = \"ClientRecognitionActivityTimeout\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"UnknownError\"] = 9] = \"UnknownError\";\n})(RecognitionCompletionStatus = exports.RecognitionCompletionStatus || (exports.RecognitionCompletionStatus = {}));\nclass RecognitionEndedEvent extends SpeechRecognitionEvent {\n constructor(requestId, audioSourceId, audioNodeId, authFetchEventId, sessionId, serviceTag, status, error) {\n super(\"RecognitionEndedEvent\", requestId, sessionId, status === RecognitionCompletionStatus.Success ? Exports_js_1.EventType.Info : Exports_js_1.EventType.Error);\n this.privAudioSourceId = audioSourceId;\n this.privAudioNodeId = audioNodeId;\n this.privAuthFetchEventId = authFetchEventId;\n this.privStatus = status;\n this.privError = error;\n this.privServiceTag = serviceTag;\n }\n get audioSourceId() {\n return this.privAudioSourceId;\n }\n get audioNodeId() {\n return this.privAudioNodeId;\n }\n get authFetchEventId() {\n return this.privAuthFetchEventId;\n }\n get serviceTag() {\n return this.privServiceTag;\n }\n get status() {\n return this.privStatus;\n }\n get error() {\n return this.privError;\n }\n}\nexports.RecognitionEndedEvent = RecognitionEndedEvent;","map":{"version":3,"names":["Object","defineProperty","exports","value","RecognitionEndedEvent","RecognitionCompletionStatus","RecognitionStartedEvent","ConnectingToServiceEvent","ListeningStartedEvent","RecognitionTriggeredEvent","SpeechRecognitionEvent","Exports_js_1","require","PlatformEvent","constructor","eventName","requestId","sessionId","eventType","EventType","Info","privRequestId","privSessionId","audioSourceId","audioNodeId","privAudioSourceId","privAudioNodeId","authFetchEventid","privAuthFetchEventid","authFetchEventId","privAuthFetchEventId","serviceTag","status","error","Success","Error","privStatus","privError","privServiceTag"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common.speech/RecognitionEvents.js"],"sourcesContent":["\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n/* eslint-disable max-classes-per-file */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RecognitionEndedEvent = exports.RecognitionCompletionStatus = exports.RecognitionStartedEvent = exports.ConnectingToServiceEvent = exports.ListeningStartedEvent = exports.RecognitionTriggeredEvent = exports.SpeechRecognitionEvent = void 0;\nconst Exports_js_1 = require(\"../common/Exports.js\");\nclass SpeechRecognitionEvent extends Exports_js_1.PlatformEvent {\n constructor(eventName, requestId, sessionId, eventType = Exports_js_1.EventType.Info) {\n super(eventName, eventType);\n this.privRequestId = requestId;\n this.privSessionId = sessionId;\n }\n get requestId() {\n return this.privRequestId;\n }\n get sessionId() {\n return this.privSessionId;\n }\n}\nexports.SpeechRecognitionEvent = SpeechRecognitionEvent;\nclass RecognitionTriggeredEvent extends SpeechRecognitionEvent {\n constructor(requestId, sessionId, audioSourceId, audioNodeId) {\n super(\"RecognitionTriggeredEvent\", requestId, sessionId);\n this.privAudioSourceId = audioSourceId;\n this.privAudioNodeId = audioNodeId;\n }\n get audioSourceId() {\n return this.privAudioSourceId;\n }\n get audioNodeId() {\n return this.privAudioNodeId;\n }\n}\nexports.RecognitionTriggeredEvent = RecognitionTriggeredEvent;\nclass ListeningStartedEvent extends SpeechRecognitionEvent {\n constructor(requestId, sessionId, audioSourceId, audioNodeId) {\n super(\"ListeningStartedEvent\", requestId, sessionId);\n this.privAudioSourceId = audioSourceId;\n this.privAudioNodeId = audioNodeId;\n }\n get audioSourceId() {\n return this.privAudioSourceId;\n }\n get audioNodeId() {\n return this.privAudioNodeId;\n }\n}\nexports.ListeningStartedEvent = ListeningStartedEvent;\nclass ConnectingToServiceEvent extends SpeechRecognitionEvent {\n constructor(requestId, authFetchEventid, sessionId) {\n super(\"ConnectingToServiceEvent\", requestId, sessionId);\n this.privAuthFetchEventid = authFetchEventid;\n }\n get authFetchEventid() {\n return this.privAuthFetchEventid;\n }\n}\nexports.ConnectingToServiceEvent = ConnectingToServiceEvent;\nclass RecognitionStartedEvent extends SpeechRecognitionEvent {\n constructor(requestId, audioSourceId, audioNodeId, authFetchEventId, sessionId) {\n super(\"RecognitionStartedEvent\", requestId, sessionId);\n this.privAudioSourceId = audioSourceId;\n this.privAudioNodeId = audioNodeId;\n this.privAuthFetchEventId = authFetchEventId;\n }\n get audioSourceId() {\n return this.privAudioSourceId;\n }\n get audioNodeId() {\n return this.privAudioNodeId;\n }\n get authFetchEventId() {\n return this.privAuthFetchEventId;\n }\n}\nexports.RecognitionStartedEvent = RecognitionStartedEvent;\nvar RecognitionCompletionStatus;\n(function (RecognitionCompletionStatus) {\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"Success\"] = 0] = \"Success\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"AudioSourceError\"] = 1] = \"AudioSourceError\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"AudioSourceTimeout\"] = 2] = \"AudioSourceTimeout\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"AuthTokenFetchError\"] = 3] = \"AuthTokenFetchError\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"AuthTokenFetchTimeout\"] = 4] = \"AuthTokenFetchTimeout\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"UnAuthorized\"] = 5] = \"UnAuthorized\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"ConnectTimeout\"] = 6] = \"ConnectTimeout\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"ConnectError\"] = 7] = \"ConnectError\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"ClientRecognitionActivityTimeout\"] = 8] = \"ClientRecognitionActivityTimeout\";\n RecognitionCompletionStatus[RecognitionCompletionStatus[\"UnknownError\"] = 9] = \"UnknownError\";\n})(RecognitionCompletionStatus = exports.RecognitionCompletionStatus || (exports.RecognitionCompletionStatus = {}));\nclass RecognitionEndedEvent extends SpeechRecognitionEvent {\n constructor(requestId, audioSourceId, audioNodeId, authFetchEventId, sessionId, serviceTag, status, error) {\n super(\"RecognitionEndedEvent\", requestId, sessionId, status === RecognitionCompletionStatus.Success ? Exports_js_1.EventType.Info : Exports_js_1.EventType.Error);\n this.privAudioSourceId = audioSourceId;\n this.privAudioNodeId = audioNodeId;\n this.privAuthFetchEventId = authFetchEventId;\n this.privStatus = status;\n this.privError = error;\n this.privServiceTag = serviceTag;\n }\n get audioSourceId() {\n return this.privAudioSourceId;\n }\n get audioNodeId() {\n return this.privAudioNodeId;\n }\n get authFetchEventId() {\n return this.privAuthFetchEventId;\n }\n get serviceTag() {\n return this.privServiceTag;\n }\n get status() {\n return this.privStatus;\n }\n get error() {\n return this.privError;\n }\n}\nexports.RecognitionEndedEvent = RecognitionEndedEvent;\n\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACA;AACAA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7DD,OAAO,CAACE,qBAAqB,GAAGF,OAAO,CAACG,2BAA2B,GAAGH,OAAO,CAACI,uBAAuB,GAAGJ,OAAO,CAACK,wBAAwB,GAAGL,OAAO,CAACM,qBAAqB,GAAGN,OAAO,CAACO,yBAAyB,GAAGP,OAAO,CAACQ,sBAAsB,GAAG,KAAK,CAAC;AACtP,MAAMC,YAAY,GAAGC,OAAO,CAAC,sBAAsB,CAAC;AACpD,MAAMF,sBAAsB,SAASC,YAAY,CAACE,aAAa,CAAC;EAC5DC,WAAWA,CAACC,SAAS,EAAEC,SAAS,EAAEC,SAAS,EAAEC,SAAS,GAAGP,YAAY,CAACQ,SAAS,CAACC,IAAI,EAAE;IAClF,KAAK,CAACL,SAAS,EAAEG,SAAS,CAAC;IAC3B,IAAI,CAACG,aAAa,GAAGL,SAAS;IAC9B,IAAI,CAACM,aAAa,GAAGL,SAAS;EAClC;EACA,IAAID,SAASA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACK,aAAa;EAC7B;EACA,IAAIJ,SAASA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACK,aAAa;EAC7B;AACJ;AACApB,OAAO,CAACQ,sBAAsB,GAAGA,sBAAsB;AACvD,MAAMD,yBAAyB,SAASC,sBAAsB,CAAC;EAC3DI,WAAWA,CAACE,SAAS,EAAEC,SAAS,EAAEM,aAAa,EAAEC,WAAW,EAAE;IAC1D,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