{"version":3,"sources":["src/sdk/SpeakerIdentificationModel.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,YAAY,EAEf,MAAM,WAAW,CAAC;AAEnB;;;;GAIG;AACH,qBAAa,0BAA0B;IACnC,OAAO,CAAC,iBAAiB,CAAsB;IAE/C,OAAO;WAYO,YAAY,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,0BAA0B;IAIhF,IAAW,eAAe,IAAI,MAAM,CAEnC;CAEJ","file":"SpeakerIdentificationModel.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n\r\nimport { Contracts } from \"./Contracts\";\r\nimport {\r\n    VoiceProfile,\r\n    VoiceProfileType,\r\n} from \"./Exports\";\r\n\r\n/**\r\n * Defines SpeakerIdentificationModel class for Speaker Recognition\r\n * Model contains a set of profiles against which to identify speaker(s)\r\n * @class SpeakerIdentificationModel\r\n */\r\nexport class SpeakerIdentificationModel {\r\n    private privVoiceProfiles: VoiceProfile[] = [];\r\n\r\n    private constructor(profiles: VoiceProfile[]) {\r\n        Contracts.throwIfNullOrUndefined(profiles, \"VoiceProfiles\");\r\n        if (profiles.length === 0) {\r\n            throw new Error(\"Empty Voice Profiles array\");\r\n        }\r\n        profiles.forEach((profile: VoiceProfile) => {\r\n            if (profile.profileType !== VoiceProfileType.TextIndependentIdentification) {\r\n                throw new Error(\"Identification model can only be created from Identification profile: \" + profile.profileId);\r\n            }\r\n            this.privVoiceProfiles.push(profile);\r\n        });\r\n    }\r\n    public static fromProfiles(profiles: VoiceProfile[]): SpeakerIdentificationModel {\r\n        return new SpeakerIdentificationModel(profiles);\r\n    }\r\n\r\n    public get voiceProfileIds(): string {\r\n        return this.privVoiceProfiles.map((profile: VoiceProfile) => profile.profileId).join(\",\");\r\n    }\r\n\r\n}\r\n"]}