56a6c38bed7f8f8497fa2e0aa539d3229ea2b1a86621a3d71c4bce0aa7dda165.json 5.0 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.SpeakerIdentificationModel = void 0;\nconst Contracts_js_1 = require(\"./Contracts.js\");\nconst Exports_js_1 = require(\"./Exports.js\");\n/**\n * Defines SpeakerIdentificationModel class for Speaker Recognition\n * Model contains a set of profiles against which to identify speaker(s)\n * @class SpeakerIdentificationModel\n */\nclass SpeakerIdentificationModel {\n constructor(profiles) {\n this.privVoiceProfiles = [];\n this.privProfileIds = [];\n Contracts_js_1.Contracts.throwIfNullOrUndefined(profiles, \"VoiceProfiles\");\n if (profiles.length === 0) {\n throw new Error(\"Empty Voice Profiles array\");\n }\n for (const profile of profiles) {\n if (profile.profileType !== Exports_js_1.VoiceProfileType.TextIndependentIdentification) {\n throw new Error(\"Identification model can only be created from Identification profile: \" + profile.profileId);\n }\n this.privVoiceProfiles.push(profile);\n this.privProfileIds.push(profile.profileId);\n }\n }\n static fromProfiles(profiles) {\n return new SpeakerIdentificationModel(profiles);\n }\n get voiceProfileIds() {\n return this.privProfileIds.join(\",\");\n }\n get profileIds() {\n return this.privProfileIds;\n }\n get scenario() {\n return \"TextIndependentIdentification\";\n }\n}\nexports.SpeakerIdentificationModel = SpeakerIdentificationModel;","map":{"version":3,"names":["Object","defineProperty","exports","value","SpeakerIdentificationModel","Contracts_js_1","require","Exports_js_1","constructor","profiles","privVoiceProfiles","privProfileIds","Contracts","throwIfNullOrUndefined","length","Error","profile","profileType","VoiceProfileType","TextIndependentIdentification","profileId","push","fromProfiles","voiceProfileIds","join","profileIds","scenario"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/SpeakerIdentificationModel.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.SpeakerIdentificationModel = void 0;\nconst Contracts_js_1 = require(\"./Contracts.js\");\nconst Exports_js_1 = require(\"./Exports.js\");\n/**\n * Defines SpeakerIdentificationModel class for Speaker Recognition\n * Model contains a set of profiles against which to identify speaker(s)\n * @class SpeakerIdentificationModel\n */\nclass SpeakerIdentificationModel {\n constructor(profiles) {\n this.privVoiceProfiles = [];\n this.privProfileIds = [];\n Contracts_js_1.Contracts.throwIfNullOrUndefined(profiles, \"VoiceProfiles\");\n if (profiles.length === 0) {\n throw new Error(\"Empty Voice Profiles array\");\n }\n for (const profile of profiles) {\n if (profile.profileType !== Exports_js_1.VoiceProfileType.TextIndependentIdentification) {\n throw new Error(\"Identification model can only be created from Identification profile: \" + profile.profileId);\n }\n this.privVoiceProfiles.push(profile);\n this.privProfileIds.push(profile.profileId);\n }\n }\n static fromProfiles(profiles) {\n return new SpeakerIdentificationModel(profiles);\n }\n get voiceProfileIds() {\n return this.privProfileIds.join(\",\");\n }\n get profileIds() {\n return this.privProfileIds;\n }\n get scenario() {\n return \"TextIndependentIdentification\";\n }\n}\nexports.SpeakerIdentificationModel = SpeakerIdentificationModel;\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,0BAA0B,GAAG,KAAK,CAAC;AAC3C,MAAMC,cAAc,GAAGC,OAAO,CAAC,gBAAgB,CAAC;AAChD,MAAMC,YAAY,GAAGD,OAAO,CAAC,cAAc,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA,MAAMF,0BAA0B,CAAC;EAC7BI,WAAWA,CAACC,QAAQ,EAAE;IAClB,IAAI,CAACC,iBAAiB,GAAG,EAAE;IAC3B,IAAI,CAACC,cAAc,GAAG,EAAE;IACxBN,cAAc,CAACO,S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