UNPKG

microsoft-cognitiveservices-speech-sdk

Version:
1 lines 2.14 kB
{"version":3,"sources":["src/sdk/SpeakerVerificationModel.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACH,YAAY,EAEf,MAAM,cAAc,CAAC;AAEtB;;;;GAIG;AACH,qBAAa,wBAAyB,YAAW,uBAAuB;IACpE,OAAO,CAAC,gBAAgB,CAAe;IAEvC,OAAO;WAQO,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,wBAAwB;IAI1E,IAAW,YAAY,IAAI,YAAY,CAEtC;IAED,IAAW,UAAU,IAAI,MAAM,EAAE,CAEhC;IAED,IAAW,QAAQ,IAAI,MAAM,CAM5B;CACJ","file":"SpeakerVerificationModel.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n\r\nimport { Contracts } from \"./Contracts.js\";\r\nimport { SpeakerRecognitionModel } from \"./SpeakerRecognitionModel.js\";\r\nimport {\r\n VoiceProfile,\r\n VoiceProfileType,\r\n} from \"./Exports.js\";\r\n\r\n/**\r\n * Defines SpeakerVerificationModel class for Speaker Recognition\r\n * Model contains a profile against which to verify a speaker\r\n * @class SpeakerVerificationModel\r\n */\r\nexport class SpeakerVerificationModel implements SpeakerRecognitionModel {\r\n private privVoiceProfile: VoiceProfile;\r\n\r\n private constructor(profile: VoiceProfile) {\r\n Contracts.throwIfNullOrUndefined(profile, \"VoiceProfile\");\r\n if (profile.profileType === VoiceProfileType.TextIndependentIdentification) {\r\n throw new Error(\"Verification model cannot be created from Identification profile\");\r\n }\r\n this.privVoiceProfile = profile;\r\n }\r\n\r\n public static fromProfile(profile: VoiceProfile): SpeakerVerificationModel {\r\n return new SpeakerVerificationModel(profile);\r\n }\r\n\r\n public get voiceProfile(): VoiceProfile {\r\n return this.privVoiceProfile;\r\n }\r\n\r\n public get profileIds(): string[] {\r\n return [ this.voiceProfile.profileId ];\r\n }\r\n\r\n public get scenario(): string {\r\n if (this.voiceProfile.profileType === VoiceProfileType.TextDependentVerification) {\r\n return \"TextDependentVerification\";\r\n } else {\r\n return \"TextIndependentVerification\";\r\n }\r\n }\r\n}\r\n"]}