1 |
- {"ast":null,"code":"\"use strict\";\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nvar _asyncToGenerator = require(\"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/asyncToGenerator.js\").default;\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.VoiceServiceRecognizer = void 0;\nconst Exports_js_1 = require(\"../common.browser/Exports.js\");\nconst Exports_js_2 = require(\"../common/Exports.js\");\nconst Exports_js_3 = require(\"../sdk/Exports.js\");\nconst Exports_js_4 = require(\"./Exports.js\");\nconst SpeechConnectionMessage_Internal_js_1 = require(\"./SpeechConnectionMessage.Internal.js\");\n// eslint-disable-next-line max-classes-per-file\nclass VoiceServiceRecognizer extends Exports_js_4.ServiceRecognizerBase {\n constructor(authentication, connectionFactory, audioSource, recognizerConfig, recognizer) {\n super(authentication, connectionFactory, audioSource, recognizerConfig, recognizer);\n this.privDeferralMap = new Exports_js_2.DeferralMap();\n this.privSpeakerAudioSource = audioSource;\n this.sendPrePayloadJSONOverride = () => this.noOp();\n }\n set SpeakerAudioSource(audioSource) {\n this.privSpeakerAudioSource = audioSource;\n }\n processTypeSpecificMessages(connectionMessage) {\n let processed = false;\n const resultProps = new Exports_js_3.PropertyCollection();\n if (connectionMessage.messageType === Exports_js_2.MessageType.Text) {\n resultProps.setProperty(Exports_js_3.PropertyId.SpeechServiceResponse_JsonResult, connectionMessage.textBody);\n }\n switch (connectionMessage.path.toLowerCase()) {\n // Profile management response for create, fetch, delete, reset\n case \"speaker.profiles\":\n const response = JSON.parse(connectionMessage.textBody);\n switch (response.operation.toLowerCase()) {\n case \"create\":\n this.handleCreateResponse(response, connectionMessage.requestId);\n break;\n case \"delete\":\n case \"reset\":\n this.handleResultResponse(response, connectionMessage.requestId);\n break;\n case \"fetch\":\n const enrollmentResponse = JSON.parse(connectionMessage.textBody);\n this.handleFetchResponse(enrollmentResponse, connectionMessage.requestId);\n break;\n default:\n break;\n }\n processed = true;\n break;\n // Activation and authorization phrase response\n case \"speaker.phrases\":\n const phraseResponse = JSON.parse(connectionMessage.textBody);\n this.handlePhrasesResponse(phraseResponse, connectionMessage.requestId);\n processed = true;\n break;\n // Enrollment response\n case \"speaker.profile.enrollment\":\n const enrollmentResponse = JSON.parse(connectionMessage.textBody);\n const result = new Exports_js_3.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(!!enrollmentResponse.enrollment ? enrollmentResponse.enrollment.enrollmentStatus : enrollmentResponse.status.statusCode), !!enrollmentResponse.enrollment ? JSON.stringify(enrollmentResponse.enrollment) : undefined, enrollmentResponse.status.reason);\n if (!!this.privDeferralMap.getId(connectionMessage.requestId)) {\n this.privDeferralMap.complete(connectionMessage.requestId, result);\n }\n this.privRequestSession.onSpeechEnded();\n processed = true;\n break;\n default:\n break;\n }\n const defferal = new Exports_js_2.Deferred();\n defferal.resolve(processed);\n return defferal.promise;\n }\n // Cancels recognition.\n cancelRecognition(sessionId, requestId, cancellationReason, errorCode, error) {\n const properties = new Exports_js_3.PropertyCollection();\n // const enrollmentResponse: EnrollmentResponse = JSON.parse(connectionMessage.textBody) as EnrollmentResponse;\n properties.setProperty(Exports_js_4.CancellationErrorCodePropertyName, Exports_js_3.CancellationErrorCode[errorCode]);\n const result = new Exports_js_3.VoiceProfileEnrollmentResult(Exports_js_3.ResultReason.Canceled, error, error);\n if (!!this.privDeferralMap.getId(requestId)) {\n this.privDeferralMap.complete(requestId, result);\n }\n }\n createProfile(profileType, locale) {\n var _this = this;\n return _asyncToGenerator(function* () {\n // Start the connection to the service. The promise this will create is stored and will be used by configureConnection().\n _this.voiceProfileType = profileType.toString();\n const conPromise = _this.connectImpl();\n try {\n const createProfileDeferral = new Exports_js_2.Deferred();\n yield conPromise;\n yield _this.sendCreateProfile(createProfileDeferral, profileType, locale);\n void _this.receiveMessage();\n return createProfileDeferral.promise;\n } catch (err) {\n throw err;\n }\n })();\n }\n resetProfile(profile) {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n _this2.voiceProfileType = profile.profileType.toString();\n return _this2.sendCommonRequest(\"reset\", profile.profileType, profile);\n })();\n }\n deleteProfile(profile) {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n _this3.voiceProfileType = profile.profileType.toString();\n return _this3.sendCommonRequest(\"delete\", profile.profileType, profile);\n })();\n }\n retrieveEnrollmentResult(profile) {\n var _this4 = this;\n return _asyncToGenerator(function* () {\n _this4.voiceProfileType = profile.profileType.toString();\n _this4.privExpectedProfileId = profile.profileId;\n return _this4.sendCommonRequest(\"fetch\", profile.profileType, profile);\n })();\n }\n getAllProfiles(profileType) {\n var _this5 = this;\n return _asyncToGenerator(function* () {\n _this5.voiceProfileType = profileType.toString();\n return _this5.sendCommonRequest(\"fetch\", profileType);\n })();\n }\n getActivationPhrases(profileType, lang) {\n var _this6 = this;\n return _asyncToGenerator(function* () {\n _this6.voiceProfileType = profileType.toString();\n // Start the connection to the service. The promise this will create is stored and will be used by configureConnection().\n const conPromise = _this6.connectImpl();\n try {\n const getPhrasesDeferral = new Exports_js_2.Deferred();\n yield conPromise;\n yield _this6.sendPhrasesRequest(getPhrasesDeferral, profileType, lang);\n void _this6.receiveMessage();\n return getPhrasesDeferral.promise;\n } catch (err) {\n throw err;\n }\n })();\n }\n enrollProfile(profile) {\n var _this7 = this;\n return _asyncToGenerator(function* () {\n _this7.voiceProfileType = profile.profileType.toString();\n const enrollmentDeferral = new Exports_js_2.Deferred();\n _this7.privRequestSession.startNewRecognition();\n _this7.privRequestSession.listenForServiceTelemetry(_this7.privSpeakerAudioSource.events);\n _this7.privRecognizerConfig.parameters.setProperty(Exports_js_3.PropertyId.Speech_SessionId, _this7.privRequestSession.sessionId);\n // Start the connection to the service. The promise this will create is stored and will be used by configureConnection().\n const conPromise = _this7.connectImpl();\n const preAudioPromise = _this7.sendPreAudioMessages(profile, enrollmentDeferral);\n const node = yield _this7.privSpeakerAudioSource.attach(_this7.privRequestSession.audioNodeId);\n const format = yield _this7.privSpeakerAudioSource.format;\n const deviceInfo = yield _this7.privSpeakerAudioSource.deviceInfo;\n const audioNode = new Exports_js_1.ReplayableAudioNode(node, format.avgBytesPerSec);\n yield _this7.privRequestSession.onAudioSourceAttachCompleted(audioNode, false);\n _this7.privRecognizerConfig.SpeechServiceConfig.Context.audio = {\n source: deviceInfo\n };\n try {\n yield conPromise;\n yield preAudioPromise;\n } catch (err) {\n _this7.cancelRecognition(_this7.privRequestSession.sessionId, _this7.privRequestSession.requestId, Exports_js_3.CancellationReason.Error, Exports_js_3.CancellationErrorCode.ConnectionFailure, err);\n }\n const sessionStartEventArgs = new Exports_js_3.SessionEventArgs(_this7.privRequestSession.sessionId);\n if (!!_this7.privRecognizer.sessionStarted) {\n _this7.privRecognizer.sessionStarted(_this7.privRecognizer, sessionStartEventArgs);\n }\n void _this7.receiveMessage();\n const audioSendPromise = _this7.sendAudio(audioNode);\n // /* eslint-disable no-empty */\n audioSendPromise.then(() => {}, error => {\n _this7.cancelRecognition(_this7.privRequestSession.sessionId, _this7.privRequestSession.requestId, Exports_js_3.CancellationReason.Error, Exports_js_3.CancellationErrorCode.RuntimeError, error);\n });\n return enrollmentDeferral.promise;\n })();\n }\n sendPreAudioMessages(profile, enrollmentDeferral) {\n var _this8 = this;\n return _asyncToGenerator(function* () {\n const connection = yield _this8.fetchConnection();\n _this8.privRequestSession.onSpeechContext();\n _this8.privDeferralMap.add(_this8.privRequestSession.requestId, enrollmentDeferral);\n yield _this8.sendBaseRequest(connection, \"enroll\", _this8.scenarioFrom(profile.profileType), profile);\n })();\n }\n sendPhrasesRequest(getPhrasesDeferral, profileType, locale) {\n var _this9 = this;\n return _asyncToGenerator(function* () {\n const connection = yield _this9.fetchConnection();\n _this9.privRequestSession.onSpeechContext();\n _this9.privDeferralMap.add(_this9.privRequestSession.requestId, getPhrasesDeferral);\n const scenario = _this9.scenarioFrom(profileType);\n const profileCreateRequest = {\n locale,\n scenario\n };\n return connection.send(new SpeechConnectionMessage_Internal_js_1.SpeechConnectionMessage(Exports_js_2.MessageType.Text, \"speaker.profile.phrases\", _this9.privRequestSession.requestId, \"application/json; charset=utf-8\", JSON.stringify(profileCreateRequest)));\n })();\n }\n sendCreateProfile(createProfileDeferral, profileType, locale) {\n var _this10 = this;\n return _asyncToGenerator(function* () {\n const connection = yield _this10.fetchConnection();\n _this10.privRequestSession.onSpeechContext();\n _this10.privDeferralMap.add(_this10.privRequestSession.requestId, createProfileDeferral);\n const scenario = profileType === Exports_js_3.VoiceProfileType.TextIndependentIdentification ? \"TextIndependentIdentification\" : profileType === Exports_js_3.VoiceProfileType.TextIndependentVerification ? \"TextIndependentVerification\" : \"TextDependentVerification\";\n const profileCreateRequest = {\n locale,\n number: \"1\",\n scenario\n };\n return connection.send(new SpeechConnectionMessage_Internal_js_1.SpeechConnectionMessage(Exports_js_2.MessageType.Text, \"speaker.profile.create\", _this10.privRequestSession.requestId, \"application/json; charset=utf-8\", JSON.stringify(profileCreateRequest)));\n })();\n }\n sendCommonRequest(operation, profileType, profile = undefined) {\n var _this11 = this;\n return _asyncToGenerator(function* () {\n // Start the connection to the service. The promise this will create is stored and will be used by configureConnection().\n const conPromise = _this11.connectImpl();\n try {\n const deferral = new Exports_js_2.Deferred();\n _this11.privRequestSession.onSpeechContext();\n yield conPromise;\n const connection = yield _this11.fetchConnection();\n _this11.privDeferralMap.add(_this11.privRequestSession.requestId, deferral);\n yield _this11.sendBaseRequest(connection, operation, _this11.scenarioFrom(profileType), profile);\n void _this11.receiveMessage();\n return deferral.promise;\n } catch (err) {\n throw err;\n }\n })();\n }\n sendBaseRequest(connection, operation, scenario, profile) {\n var _this12 = this;\n return _asyncToGenerator(function* () {\n const profileRequest = {\n scenario\n };\n if (!!profile) {\n profileRequest.profileIds = [profile.profileId];\n } else {\n profileRequest.maxPageSize = -1;\n }\n return connection.send(new SpeechConnectionMessage_Internal_js_1.SpeechConnectionMessage(Exports_js_2.MessageType.Text, `speaker.profile.${operation}`, _this12.privRequestSession.requestId, \"application/json; charset=utf-8\", JSON.stringify(profileRequest)));\n })();\n }\n extractSpeakerContext(model) {\n return {\n features: {\n interimResult: \"enabled\",\n progressiveDetection: \"disabled\"\n },\n profileIds: model.profileIds,\n scenario: model.scenario\n };\n }\n handlePhrasesResponse(response, requestId) {\n if (!!this.privDeferralMap.getId(requestId)) {\n if (response.status.statusCode.toLowerCase() !== \"success\") {\n const reason = Exports_js_3.ResultReason.Canceled;\n const result = new Exports_js_3.VoiceProfilePhraseResult(reason, response.status.statusCode, response.passPhraseType, []);\n this.privDeferralMap.complete(requestId, result);\n } else if (!!response.phrases && response.phrases.length > 0) {\n const reason = Exports_js_3.ResultReason.EnrollingVoiceProfile;\n const result = new Exports_js_3.VoiceProfilePhraseResult(reason, response.status.statusCode, response.passPhraseType, response.phrases);\n this.privDeferralMap.complete(requestId, result);\n } else {\n throw new Error(\"Voice Profile get activation phrases failed, no phrases received\");\n }\n } else {\n throw new Error(`Voice Profile get activation phrases request for requestID ${requestId} not found`);\n }\n }\n handleCreateResponse(response, requestId) {\n if (!!response.profiles && response.profiles.length > 0) {\n if (!!this.privDeferralMap.getId(requestId)) {\n const profileIds = response.profiles.map(profile => profile.profileId);\n this.privDeferralMap.complete(requestId, profileIds);\n } else {\n throw new Error(`Voice Profile create request for requestID ${requestId} not found`);\n }\n } else {\n throw new Error(\"Voice Profile create failed, no profile id received\");\n }\n }\n handleResultResponse(response, requestId) {\n if (!!this.privDeferralMap.getId(requestId)) {\n const successReason = response.operation.toLowerCase() === \"delete\" ? Exports_js_3.ResultReason.DeletedVoiceProfile : Exports_js_3.ResultReason.ResetVoiceProfile;\n const reason = response.status.statusCode.toLowerCase() === \"success\" ? successReason : Exports_js_3.ResultReason.Canceled;\n const result = new Exports_js_3.VoiceProfileResult(reason, `statusCode: ${response.status.statusCode}, errorDetails: ${response.status.reason}`);\n this.privDeferralMap.complete(requestId, result);\n } else {\n throw new Error(`Voice Profile create request for requestID ${requestId} not found`);\n }\n }\n handleFetchResponse(enrollmentResponse, requestId) {\n if (!!this.privDeferralMap.getId(requestId) && !!enrollmentResponse.profiles[0]) {\n if (!!this.privExpectedProfileId && enrollmentResponse.profiles.length === 1 && enrollmentResponse.profiles[0].profileId === this.privExpectedProfileId) {\n this.privExpectedProfileId = undefined;\n const profileInfo = enrollmentResponse.profiles[0];\n const result = new Exports_js_3.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(profileInfo.enrollmentStatus), JSON.stringify(profileInfo), enrollmentResponse.status.reason);\n this.privDeferralMap.complete(requestId, result);\n } else if (enrollmentResponse.profiles.length > 0) {\n const iProfiles = enrollmentResponse.profiles;\n const profileResults = [];\n for (const profile of iProfiles) {\n profileResults.push(new Exports_js_3.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(profile.enrollmentStatus), JSON.stringify(profile), enrollmentResponse.status.reason));\n }\n this.privDeferralMap.complete(requestId, profileResults);\n }\n } else {\n throw new Error(`Voice Profile fetch request for requestID ${requestId} not found`);\n }\n }\n enrollmentReasonFrom(statusCode) {\n switch (statusCode.toLowerCase()) {\n case \"enrolled\":\n return Exports_js_3.ResultReason.EnrolledVoiceProfile;\n case \"invalidlocale\":\n case \"invalidphrase\":\n case \"invalidaudioformat\":\n case \"invalidscenario\":\n case \"invalidprofilecount\":\n case \"invalidoperation\":\n case \"audiotooshort\":\n case \"audiotoolong\":\n case \"toomanyenrollments\":\n case \"storageconflict\":\n case \"profilenotfound\":\n case \"incompatibleprofiles\":\n case \"incompleteenrollment\":\n return Exports_js_3.ResultReason.Canceled;\n default:\n return Exports_js_3.ResultReason.EnrollingVoiceProfile;\n }\n }\n scenarioFrom(profileType) {\n return profileType === Exports_js_3.VoiceProfileType.TextIndependentIdentification ? \"TextIndependentIdentification\" : profileType === Exports_js_3.VoiceProfileType.TextIndependentVerification ? \"TextIndependentVerification\" : \"TextDependentVerification\";\n }\n}\nexports.VoiceServiceRecognizer = VoiceServiceRecognizer;","map":{"version":3,"names":["_asyncToGenerator","require","default","Object","defineProperty","exports","value","VoiceServiceRecognizer","Exports_js_1","Exports_js_2","Exports_js_3","Exports_js_4","SpeechConnectionMessage_Internal_js_1","ServiceRecognizerBase","constructor","authentication","connectionFactory","audioSource","recognizerConfig","recognizer","privDeferralMap","DeferralMap","privSpeakerAudioSource","sendPrePayloadJSONOverride","noOp","SpeakerAudioSource","processTypeSpecificMessages","connectionMessage","processed","resultProps","PropertyCollection","messageType","MessageType","Text","setProperty","PropertyId","SpeechServiceResponse_JsonResult","textBody","path","toLowerCase","response","JSON","parse","operation","handleCreateResponse","requestId","handleResultResponse","enrollmentResponse","handleFetchResponse","phraseResponse","handlePhrasesResponse","result","VoiceProfileEnrollmentResult","enrollmentReasonFrom","enrollment","enrollmentStatus","status","statusCode","stringify","undefined","reason","getId","complete","privRequestSession","onSpeechEnded","defferal","Deferred","resolve","promise","cancelRecognition","sessionId","cancellationReason","errorCode","error","properties","CancellationErrorCodePropertyName","CancellationErrorCode","ResultReason","Canceled","createProfile","profileType","locale","_this","voiceProfileType","toString","conPromise","connectImpl","createProfileDeferral","sendCreateProfile","receiveMessage","err","resetProfile","profile","_this2","sendCommonRequest","deleteProfile","_this3","retrieveEnrollmentResult","_this4","privExpectedProfileId","profileId","getAllProfiles","_this5","getActivationPhrases","lang","_this6","getPhrasesDeferral","sendPhrasesRequest","enrollProfile","_this7","enrollmentDeferral","startNewRecognition","listenForServiceTelemetry","events","privRecognizerConfig","parameters","Speech_SessionId","preAudioPromise","sendPreAudioMessages","node","attach","audioNodeId","format","deviceInfo","audioNode","ReplayableAudioNode","avgBytesPerSec","onAudioSourceAttachCompleted","SpeechServiceConfig","Context","audio","source","CancellationReason","Error","ConnectionFailure","sessionStartEventArgs","SessionEventArgs","privRecognizer","sessionStarted","audioSendPromise","sendAudio","then","RuntimeError","_this8","connection","fetchConnection","onSpeechContext","add","sendBaseRequest","scenarioFrom","_this9","scenario","profileCreateRequest","send","SpeechConnectionMessage","_this10","VoiceProfileType","TextIndependentIdentification","TextIndependentVerification","number","_this11","deferral","_this12","profileRequest","profileIds","maxPageSize","extractSpeakerContext","model","features","interimResult","progressiveDetection","VoiceProfilePhraseResult","passPhraseType","phrases","length","EnrollingVoiceProfile","profiles","map","successReason","DeletedVoiceProfile","ResetVoiceProfile","VoiceProfileResult","profileInfo","iProfiles","profileResults","push","EnrolledVoiceProfile"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common.speech/VoiceServiceRecognizer.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.VoiceServiceRecognizer = void 0;\nconst Exports_js_1 = require(\"../common.browser/Exports.js\");\nconst Exports_js_2 = require(\"../common/Exports.js\");\nconst Exports_js_3 = require(\"../sdk/Exports.js\");\nconst Exports_js_4 = require(\"./Exports.js\");\nconst SpeechConnectionMessage_Internal_js_1 = require(\"./SpeechConnectionMessage.Internal.js\");\n// eslint-disable-next-line max-classes-per-file\nclass VoiceServiceRecognizer extends Exports_js_4.ServiceRecognizerBase {\n constructor(authentication, connectionFactory, audioSource, recognizerConfig, recognizer) {\n super(authentication, connectionFactory, audioSource, recognizerConfig, recognizer);\n this.privDeferralMap = new Exports_js_2.DeferralMap();\n this.privSpeakerAudioSource = audioSource;\n this.sendPrePayloadJSONOverride = () => this.noOp();\n }\n set SpeakerAudioSource(audioSource) {\n this.privSpeakerAudioSource = audioSource;\n }\n processTypeSpecificMessages(connectionMessage) {\n let processed = false;\n const resultProps = new Exports_js_3.PropertyCollection();\n if (connectionMessage.messageType === Exports_js_2.MessageType.Text) {\n resultProps.setProperty(Exports_js_3.PropertyId.SpeechServiceResponse_JsonResult, connectionMessage.textBody);\n }\n switch (connectionMessage.path.toLowerCase()) {\n // Profile management response for create, fetch, delete, reset\n case \"speaker.profiles\":\n const response = JSON.parse(connectionMessage.textBody);\n switch (response.operation.toLowerCase()) {\n case \"create\":\n this.handleCreateResponse(response, connectionMessage.requestId);\n break;\n case \"delete\":\n case \"reset\":\n this.handleResultResponse(response, connectionMessage.requestId);\n break;\n case \"fetch\":\n const enrollmentResponse = JSON.parse(connectionMessage.textBody);\n this.handleFetchResponse(enrollmentResponse, connectionMessage.requestId);\n break;\n default:\n break;\n }\n processed = true;\n break;\n // Activation and authorization phrase response\n case \"speaker.phrases\":\n const phraseResponse = JSON.parse(connectionMessage.textBody);\n this.handlePhrasesResponse(phraseResponse, connectionMessage.requestId);\n processed = true;\n break;\n // Enrollment response\n case \"speaker.profile.enrollment\":\n const enrollmentResponse = JSON.parse(connectionMessage.textBody);\n const result = new Exports_js_3.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(!!enrollmentResponse.enrollment ? enrollmentResponse.enrollment.enrollmentStatus : enrollmentResponse.status.statusCode), !!enrollmentResponse.enrollment ? JSON.stringify(enrollmentResponse.enrollment) : undefined, enrollmentResponse.status.reason);\n if (!!this.privDeferralMap.getId(connectionMessage.requestId)) {\n this.privDeferralMap.complete(connectionMessage.requestId, result);\n }\n this.privRequestSession.onSpeechEnded();\n processed = true;\n break;\n default:\n break;\n }\n const defferal = new Exports_js_2.Deferred();\n defferal.resolve(processed);\n return defferal.promise;\n }\n // Cancels recognition.\n cancelRecognition(sessionId, requestId, cancellationReason, errorCode, error) {\n const properties = new Exports_js_3.PropertyCollection();\n // const enrollmentResponse: EnrollmentResponse = JSON.parse(connectionMessage.textBody) as EnrollmentResponse;\n properties.setProperty(Exports_js_4.CancellationErrorCodePropertyName, Exports_js_3.CancellationErrorCode[errorCode]);\n const result = new Exports_js_3.VoiceProfileEnrollmentResult(Exports_js_3.ResultReason.Canceled, error, error);\n if (!!this.privDeferralMap.getId(requestId)) {\n this.privDeferralMap.complete(requestId, result);\n }\n }\n async createProfile(profileType, locale) {\n // Start the connection to the service. The promise this will create is stored and will be used by configureConnection().\n this.voiceProfileType = profileType.toString();\n const conPromise = this.connectImpl();\n try {\n const createProfileDeferral = new Exports_js_2.Deferred();\n await conPromise;\n await this.sendCreateProfile(createProfileDeferral, profileType, locale);\n void this.receiveMessage();\n return createProfileDeferral.promise;\n }\n catch (err) {\n throw err;\n }\n }\n async resetProfile(profile) {\n this.voiceProfileType = profile.profileType.toString();\n return this.sendCommonRequest(\"reset\", profile.profileType, profile);\n }\n async deleteProfile(profile) {\n this.voiceProfileType = profile.profileType.toString();\n return this.sendCommonRequest(\"delete\", profile.profileType, profile);\n }\n async retrieveEnrollmentResult(profile) {\n this.voiceProfileType = profile.profileType.toString();\n this.privExpectedProfileId = profile.profileId;\n return this.sendCommonRequest(\"fetch\", profile.profileType, profile);\n }\n async getAllProfiles(profileType) {\n this.voiceProfileType = profileType.toString();\n return this.sendCommonRequest(\"fetch\", profileType);\n }\n async getActivationPhrases(profileType, lang) {\n this.voiceProfileType = profileType.toString();\n // Start the connection to the service. The promise this will create is stored and will be used by configureConnection().\n const conPromise = this.connectImpl();\n try {\n const getPhrasesDeferral = new Exports_js_2.Deferred();\n await conPromise;\n await this.sendPhrasesRequest(getPhrasesDeferral, profileType, lang);\n void this.receiveMessage();\n return getPhrasesDeferral.promise;\n }\n catch (err) {\n throw err;\n }\n }\n async enrollProfile(profile) {\n this.voiceProfileType = profile.profileType.toString();\n const enrollmentDeferral = new Exports_js_2.Deferred();\n this.privRequestSession.startNewRecognition();\n this.privRequestSession.listenForServiceTelemetry(this.privSpeakerAudioSource.events);\n this.privRecognizerConfig.parameters.setProperty(Exports_js_3.PropertyId.Speech_SessionId, this.privRequestSession.sessionId);\n // Start the connection to the service. The promise this will create is stored and will be used by configureConnection().\n const conPromise = this.connectImpl();\n const preAudioPromise = this.sendPreAudioMessages(profile, enrollmentDeferral);\n const node = await this.privSpeakerAudioSource.attach(this.privRequestSession.audioNodeId);\n const format = await this.privSpeakerAudioSource.format;\n const deviceInfo = await this.privSpeakerAudioSource.deviceInfo;\n const audioNode = new Exports_js_1.ReplayableAudioNode(node, format.avgBytesPerSec);\n await this.privRequestSession.onAudioSourceAttachCompleted(audioNode, false);\n this.privRecognizerConfig.SpeechServiceConfig.Context.audio = { source: deviceInfo };\n try {\n await conPromise;\n await preAudioPromise;\n }\n catch (err) {\n this.cancelRecognition(this.privRequestSession.sessionId, this.privRequestSession.requestId, Exports_js_3.CancellationReason.Error, Exports_js_3.CancellationErrorCode.ConnectionFailure, err);\n }\n const sessionStartEventArgs = new Exports_js_3.SessionEventArgs(this.privRequestSession.sessionId);\n if (!!this.privRecognizer.sessionStarted) {\n this.privRecognizer.sessionStarted(this.privRecognizer, sessionStartEventArgs);\n }\n void this.receiveMessage();\n const audioSendPromise = this.sendAudio(audioNode);\n // /* eslint-disable no-empty */\n audioSendPromise.then(() => { }, (error) => {\n this.cancelRecognition(this.privRequestSession.sessionId, this.privRequestSession.requestId, Exports_js_3.CancellationReason.Error, Exports_js_3.CancellationErrorCode.RuntimeError, error);\n });\n return enrollmentDeferral.promise;\n }\n async sendPreAudioMessages(profile, enrollmentDeferral) {\n const connection = await this.fetchConnection();\n this.privRequestSession.onSpeechContext();\n this.privDeferralMap.add(this.privRequestSession.requestId, enrollmentDeferral);\n await this.sendBaseRequest(connection, \"enroll\", this.scenarioFrom(profile.profileType), profile);\n }\n async sendPhrasesRequest(getPhrasesDeferral, profileType, locale) {\n const connection = await this.fetchConnection();\n this.privRequestSession.onSpeechContext();\n this.privDeferralMap.add(this.privRequestSession.requestId, getPhrasesDeferral);\n const scenario = this.scenarioFrom(profileType);\n const profileCreateRequest = {\n locale,\n scenario,\n };\n return connection.send(new SpeechConnectionMessage_Internal_js_1.SpeechConnectionMessage(Exports_js_2.MessageType.Text, \"speaker.profile.phrases\", this.privRequestSession.requestId, \"application/json; charset=utf-8\", JSON.stringify(profileCreateRequest)));\n }\n async sendCreateProfile(createProfileDeferral, profileType, locale) {\n const connection = await this.fetchConnection();\n this.privRequestSession.onSpeechContext();\n this.privDeferralMap.add(this.privRequestSession.requestId, createProfileDeferral);\n const scenario = profileType === Exports_js_3.VoiceProfileType.TextIndependentIdentification ? \"TextIndependentIdentification\" :\n profileType === Exports_js_3.VoiceProfileType.TextIndependentVerification ? \"TextIndependentVerification\" : \"TextDependentVerification\";\n const profileCreateRequest = {\n locale,\n number: \"1\",\n scenario,\n };\n return connection.send(new SpeechConnectionMessage_Internal_js_1.SpeechConnectionMessage(Exports_js_2.MessageType.Text, \"speaker.profile.create\", this.privRequestSession.requestId, \"application/json; charset=utf-8\", JSON.stringify(profileCreateRequest)));\n }\n async sendCommonRequest(operation, profileType, profile = undefined) {\n // Start the connection to the service. The promise this will create is stored and will be used by configureConnection().\n const conPromise = this.connectImpl();\n try {\n const deferral = new Exports_js_2.Deferred();\n this.privRequestSession.onSpeechContext();\n await conPromise;\n const connection = await this.fetchConnection();\n this.privDeferralMap.add(this.privRequestSession.requestId, deferral);\n await this.sendBaseRequest(connection, operation, this.scenarioFrom(profileType), profile);\n void this.receiveMessage();\n return deferral.promise;\n }\n catch (err) {\n throw err;\n }\n }\n async sendBaseRequest(connection, operation, scenario, profile) {\n const profileRequest = {\n scenario\n };\n if (!!profile) {\n profileRequest.profileIds = [profile.profileId];\n }\n else {\n profileRequest.maxPageSize = -1;\n }\n return connection.send(new SpeechConnectionMessage_Internal_js_1.SpeechConnectionMessage(Exports_js_2.MessageType.Text, `speaker.profile.${operation}`, this.privRequestSession.requestId, \"application/json; charset=utf-8\", JSON.stringify(profileRequest)));\n }\n extractSpeakerContext(model) {\n return {\n features: {\n interimResult: \"enabled\",\n progressiveDetection: \"disabled\",\n },\n profileIds: model.profileIds,\n scenario: model.scenario,\n };\n }\n handlePhrasesResponse(response, requestId) {\n if (!!this.privDeferralMap.getId(requestId)) {\n if (response.status.statusCode.toLowerCase() !== \"success\") {\n const reason = Exports_js_3.ResultReason.Canceled;\n const result = new Exports_js_3.VoiceProfilePhraseResult(reason, response.status.statusCode, response.passPhraseType, []);\n this.privDeferralMap.complete(requestId, result);\n }\n else if (!!response.phrases && response.phrases.length > 0) {\n const reason = Exports_js_3.ResultReason.EnrollingVoiceProfile;\n const result = new Exports_js_3.VoiceProfilePhraseResult(reason, response.status.statusCode, response.passPhraseType, response.phrases);\n this.privDeferralMap.complete(requestId, result);\n }\n else {\n throw new Error(\"Voice Profile get activation phrases failed, no phrases received\");\n }\n }\n else {\n throw new Error(`Voice Profile get activation phrases request for requestID ${requestId} not found`);\n }\n }\n handleCreateResponse(response, requestId) {\n if (!!response.profiles && response.profiles.length > 0) {\n if (!!this.privDeferralMap.getId(requestId)) {\n const profileIds = response.profiles.map((profile) => profile.profileId);\n this.privDeferralMap.complete(requestId, profileIds);\n }\n else {\n throw new Error(`Voice Profile create request for requestID ${requestId} not found`);\n }\n }\n else {\n throw new Error(\"Voice Profile create failed, no profile id received\");\n }\n }\n handleResultResponse(response, requestId) {\n if (!!this.privDeferralMap.getId(requestId)) {\n const successReason = response.operation.toLowerCase() === \"delete\" ? Exports_js_3.ResultReason.DeletedVoiceProfile : Exports_js_3.ResultReason.ResetVoiceProfile;\n const reason = response.status.statusCode.toLowerCase() === \"success\" ? successReason : Exports_js_3.ResultReason.Canceled;\n const result = new Exports_js_3.VoiceProfileResult(reason, `statusCode: ${response.status.statusCode}, errorDetails: ${response.status.reason}`);\n this.privDeferralMap.complete(requestId, result);\n }\n else {\n throw new Error(`Voice Profile create request for requestID ${requestId} not found`);\n }\n }\n handleFetchResponse(enrollmentResponse, requestId) {\n if (!!this.privDeferralMap.getId(requestId) && !!enrollmentResponse.profiles[0]) {\n if (!!this.privExpectedProfileId && enrollmentResponse.profiles.length === 1 && enrollmentResponse.profiles[0].profileId === this.privExpectedProfileId) {\n this.privExpectedProfileId = undefined;\n const profileInfo = enrollmentResponse.profiles[0];\n const result = new Exports_js_3.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(profileInfo.enrollmentStatus), JSON.stringify(profileInfo), enrollmentResponse.status.reason);\n this.privDeferralMap.complete(requestId, result);\n }\n else if (enrollmentResponse.profiles.length > 0) {\n const iProfiles = enrollmentResponse.profiles;\n const profileResults = [];\n for (const profile of iProfiles) {\n profileResults.push(new Exports_js_3.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(profile.enrollmentStatus), JSON.stringify(profile), enrollmentResponse.status.reason));\n }\n this.privDeferralMap.complete(requestId, profileResults);\n }\n }\n else {\n throw new Error(`Voice Profile fetch request for requestID ${requestId} not found`);\n }\n }\n enrollmentReasonFrom(statusCode) {\n switch (statusCode.toLowerCase()) {\n case \"enrolled\":\n return Exports_js_3.ResultReason.EnrolledVoiceProfile;\n case \"invalidlocale\":\n case \"invalidphrase\":\n case \"invalidaudioformat\":\n case \"invalidscenario\":\n case \"invalidprofilecount\":\n case \"invalidoperation\":\n case \"audiotooshort\":\n case \"audiotoolong\":\n case \"toomanyenrollments\":\n case \"storageconflict\":\n case \"profilenotfound\":\n case \"incompatibleprofiles\":\n case \"incompleteenrollment\":\n return Exports_js_3.ResultReason.Canceled;\n default:\n return Exports_js_3.ResultReason.EnrollingVoiceProfile;\n }\n }\n scenarioFrom(profileType) {\n return profileType === Exports_js_3.VoiceProfileType.TextIndependentIdentification ? \"TextIndependentIdentification\" :\n profileType === Exports_js_3.VoiceProfileType.TextIndependentVerification ? \"TextIndependentVerification\" : \"TextDependentVerification\";\n }\n}\nexports.VoiceServiceRecognizer = VoiceServiceRecognizer;\n\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AAAA,IAAAA,iBAAA,GAAAC,OAAA,qGAAAC,OAAA;AACAC,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7DD,OAAO,CAACE,sBAAsB,GAAG,KAAK,CAAC;AACvC,MAAMC,YAAY,GAAGP,OAAO,CAAC,8BAA8B,CAAC;AAC5D,MAAMQ,YAAY,GAAGR,OAAO,CAAC,sBAAsB,CAAC;AACpD,MAAMS,YAAY,GAAGT,OAAO,CAAC,mBAAmB,CAAC;AACjD,MAAMU,YAAY,GAAGV,OAAO,CAAC,cAAc,CAAC;AAC5C,MAAMW,qCAAqC,G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