7d686acc1ecf3aee47566a4460248d9c332aa02df7e24a368ec6d14ddf0aea65.json 13 KB

1
  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.AvatarSynthesisAdapter = void 0;\nconst Exports_js_1 = require(\"../sdk/Exports.js\");\nconst Exports_js_2 = require(\"./Exports.js\");\nclass AvatarSynthesisAdapter extends Exports_js_2.SynthesisAdapterBase {\n constructor(authentication, connectionFactory, synthesizerConfig, avatarSynthesizer, avatarConfig) {\n super(authentication, connectionFactory, synthesizerConfig, undefined);\n this.privAvatarSynthesizer = avatarSynthesizer;\n this.privSynthesizer = avatarSynthesizer;\n this.privAvatarConfig = avatarConfig;\n }\n setSynthesisContextSynthesisSection() {\n this.privSynthesisContext.setSynthesisSection(undefined);\n }\n setSpeechConfigSynthesisSection() {\n var _this$privAvatarConfi, _this$privAvatarConfi2, _this$privAvatarConfi3, _this$privAvatarConfi4, _this$privAvatarConfi5, _this$privAvatarConfi6, _this$privAvatarConfi7, _this$privAvatarConfi8, _this$privAvatarConfi9, _this$privAvatarConfi10;\n this.privSynthesizerConfig.synthesisVideoSection = {\n format: {\n bitrate: (_this$privAvatarConfi = this.privAvatarConfig.videoFormat) === null || _this$privAvatarConfi === void 0 ? void 0 : _this$privAvatarConfi.bitrate,\n codec: (_this$privAvatarConfi2 = this.privAvatarConfig.videoFormat) === null || _this$privAvatarConfi2 === void 0 ? void 0 : _this$privAvatarConfi2.codec,\n crop: {\n bottomRight: {\n x: (_this$privAvatarConfi3 = this.privAvatarConfig.videoFormat) === null || _this$privAvatarConfi3 === void 0 || (_this$privAvatarConfi3 = _this$privAvatarConfi3.cropRange) === null || _this$privAvatarConfi3 === void 0 || (_this$privAvatarConfi3 = _this$privAvatarConfi3.bottomRight) === null || _this$privAvatarConfi3 === void 0 ? void 0 : _this$privAvatarConfi3.x,\n y: (_this$privAvatarConfi4 = this.privAvatarConfig.videoFormat) === null || _this$privAvatarConfi4 === void 0 || (_this$privAvatarConfi4 = _this$privAvatarConfi4.cropRange) === null || _this$privAvatarConfi4 === void 0 || (_this$privAvatarConfi4 = _this$privAvatarConfi4.bottomRight) === null || _this$privAvatarConfi4 === void 0 ? void 0 : _this$privAvatarConfi4.y\n },\n topLeft: {\n x: (_this$privAvatarConfi5 = this.privAvatarConfig.videoFormat) === null || _this$privAvatarConfi5 === void 0 || (_this$privAvatarConfi5 = _this$privAvatarConfi5.cropRange) === null || _this$privAvatarConfi5 === void 0 || (_this$privAvatarConfi5 = _this$privAvatarConfi5.topLeft) === null || _this$privAvatarConfi5 === void 0 ? void 0 : _this$privAvatarConfi5.x,\n y: (_this$privAvatarConfi6 = this.privAvatarConfig.videoFormat) === null || _this$privAvatarConfi6 === void 0 || (_this$privAvatarConfi6 = _this$privAvatarConfi6.cropRange) === null || _this$privAvatarConfi6 === void 0 || (_this$privAvatarConfi6 = _this$privAvatarConfi6.topLeft) === null || _this$privAvatarConfi6 === void 0 ? void 0 : _this$privAvatarConfi6.y\n }\n },\n resolution: {\n height: (_this$privAvatarConfi7 = this.privAvatarConfig.videoFormat) === null || _this$privAvatarConfi7 === void 0 ? void 0 : _this$privAvatarConfi7.height,\n width: (_this$privAvatarConfi8 = this.privAvatarConfig.videoFormat) === null || _this$privAvatarConfi8 === void 0 ? void 0 : _this$privAvatarConfi8.width\n }\n },\n protocol: {\n name: \"WebRTC\",\n webrtcConfig: {\n clientDescription: btoa(this.privSynthesizerConfig.parameters.getProperty(Exports_js_1.PropertyId.TalkingAvatarService_WebRTC_SDP)),\n iceServers: (_this$privAvatarConfi9 = this.privAvatarConfig.remoteIceServers) !== null && _this$privAvatarConfi9 !== void 0 ? _this$privAvatarConfi9 : this.privAvatarSynthesizer.iceServers\n }\n },\n talkingAvatar: {\n background: {\n color: this.privAvatarConfig.backgroundColor,\n image: {\n url: (_this$privAvatarConfi10 = this.privAvatarConfig.backgroundImage) === null || _this$privAvatarConfi10 === void 0 ? void 0 : _this$privAvatarConfi10.toString()\n }\n },\n character: this.privAvatarConfig.character,\n customized: this.privAvatarConfig.customized,\n style: this.privAvatarConfig.style\n }\n };\n }\n onAvatarEvent(metadata) {\n if (!!this.privAvatarSynthesizer.avatarEventReceived) {\n const avatarEventArgs = new Exports_js_1.AvatarEventArgs(metadata.Data.Offset, metadata.Data.Name);\n try {\n this.privAvatarSynthesizer.avatarEventReceived(this.privAvatarSynthesizer, avatarEventArgs);\n } catch (error) {\n // Not going to let errors in the event handler\n // trip things up.\n }\n }\n }\n}\nexports.AvatarSynthesisAdapter = AvatarSynthesisAdapter;","map":{"version":3,"names":["Object","defineProperty","exports","value","AvatarSynthesisAdapter","Exports_js_1","require","Exports_js_2","SynthesisAdapterBase","constructor","authentication","connectionFactory","synthesizerConfig","avatarSynthesizer","avatarConfig","undefined","privAvatarSynthesizer","privSynthesizer","privAvatarConfig","setSynthesisContextSynthesisSection","privSynthesisContext","setSynthesisSection","setSpeechConfigSynthesisSection","_this$privAvatarConfi","_this$privAvatarConfi2","_this$privAvatarConfi3","_this$privAvatarConfi4","_this$privAvatarConfi5","_this$privAvatarConfi6","_this$privAvatarConfi7","_this$privAvatarConfi8","_this$privAvatarConfi9","_this$privAvatarConfi10","privSynthesizerConfig","synthesisVideoSection","format","bitrate","videoFormat","codec","crop","bottomRight","x","cropRange","y","topLeft","resolution","height","width","protocol","name","webrtcConfig","clientDescription","btoa","parameters","getProperty","PropertyId","TalkingAvatarService_WebRTC_SDP","iceServers","remoteIceServers","talkingAvatar","background","color","backgroundColor","image","url","backgroundImage","toString","character","customized","style","onAvatarEvent","metadata","avatarEventReceived","avatarEventArgs","AvatarEventArgs","Data","Offset","Name","error"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common.speech/AvatarSynthesisAdapter.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.AvatarSynthesisAdapter = void 0;\nconst Exports_js_1 = require(\"../sdk/Exports.js\");\nconst Exports_js_2 = require(\"./Exports.js\");\nclass AvatarSynthesisAdapter extends Exports_js_2.SynthesisAdapterBase {\n constructor(authentication, connectionFactory, synthesizerConfig, avatarSynthesizer, avatarConfig) {\n super(authentication, connectionFactory, synthesizerConfig, undefined);\n this.privAvatarSynthesizer = avatarSynthesizer;\n this.privSynthesizer = avatarSynthesizer;\n this.privAvatarConfig = avatarConfig;\n }\n setSynthesisContextSynthesisSection() {\n this.privSynthesisContext.setSynthesisSection(undefined);\n }\n setSpeechConfigSynthesisSection() {\n this.privSynthesizerConfig.synthesisVideoSection = {\n format: {\n bitrate: this.privAvatarConfig.videoFormat?.bitrate,\n codec: this.privAvatarConfig.videoFormat?.codec,\n crop: {\n bottomRight: {\n x: this.privAvatarConfig.videoFormat?.cropRange?.bottomRight?.x,\n y: this.privAvatarConfig.videoFormat?.cropRange?.bottomRight?.y,\n },\n topLeft: {\n x: this.privAvatarConfig.videoFormat?.cropRange?.topLeft?.x,\n y: this.privAvatarConfig.videoFormat?.cropRange?.topLeft?.y,\n },\n },\n resolution: {\n height: this.privAvatarConfig.videoFormat?.height,\n width: this.privAvatarConfig.videoFormat?.width,\n },\n },\n protocol: {\n name: \"WebRTC\",\n webrtcConfig: {\n clientDescription: btoa(this.privSynthesizerConfig.parameters.getProperty(Exports_js_1.PropertyId.TalkingAvatarService_WebRTC_SDP)),\n iceServers: this.privAvatarConfig.remoteIceServers ?? this.privAvatarSynthesizer.iceServers,\n },\n },\n talkingAvatar: {\n background: {\n color: this.privAvatarConfig.backgroundColor,\n image: {\n url: this.privAvatarConfig.backgroundImage?.toString(),\n }\n },\n character: this.privAvatarConfig.character,\n customized: this.privAvatarConfig.customized,\n style: this.privAvatarConfig.style,\n }\n };\n }\n onAvatarEvent(metadata) {\n if (!!this.privAvatarSynthesizer.avatarEventReceived) {\n const avatarEventArgs = new Exports_js_1.AvatarEventArgs(metadata.Data.Offset, metadata.Data.Name);\n try {\n this.privAvatarSynthesizer.avatarEventReceived(this.privAvatarSynthesizer, avatarEventArgs);\n }\n catch (error) {\n // Not going to let errors in the event handler\n // trip things up.\n }\n }\n }\n}\nexports.AvatarSynthesisAdapter = AvatarSynthesisAdapter;\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,sBAAsB,GAAG,KAAK,CAAC;AACvC,MAAMC,YAAY,GAAGC,OAAO,CAAC,mBAAmB,CAAC;AACjD,MAAMC,YAAY,GAAGD,OAAO,CAAC,cAAc,CAAC;AAC5C,MAAMF,sBAAsB,SAASG,YAAY,CAACC,oBAAoB,CAAC;EACnEC,WAAWA,CAACC,cAAc,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,YAAY,EAAE;IAC/F,KAAK,CAACJ,cAAc,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEG,SAAS,CAAC;IACtE,IAAI,CAACC,qBAAqB,GAAGH,iBAAiB;IAC9C,IAAI,CAACI,eAAe,GAAGJ,iBAAiB;IACxC,IAAI,CAACK,gBAAgB,GAAGJ,YAAY;EACxC;EACAK,mCAAmCA,CAAA,EAAG;IAClC,IAAI,CAACC,oBAAoB,CAACC,mBAAmB,CAACN,SAAS,CAAC;EAC5D;EACAO,+BAA+BA,CAAA,EAAG;IAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,uBAAA;IAC9B,IAAI,CAACC,qBAAqB,CAACC,qBAAqB,GAAG;MAC/CC,MAAM,EAAE;QACJC,OAAO,GAAAb,qBAAA,GAAE,IAAI,CAAC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