{"version":3,"sources":["src/sdk/SpeakerIdentificationModel.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACH,YAAY,EAEf,MAAM,cAAc,CAAC;AAEtB;;;;GAIG;AACH,qBAAa,0BAA2B,YAAW,uBAAuB;IACtE,OAAO,CAAC,iBAAiB,CAAsB;IAC/C,OAAO,CAAC,cAAc,CAAgB;IAEtC,OAAO;WAaO,YAAY,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,0BAA0B;IAIhF,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,UAAU,IAAI,MAAM,EAAE,CAEhC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;CACJ","file":"SpeakerIdentificationModel.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n\nimport { Contracts } from \"./Contracts.js\";\nimport { SpeakerRecognitionModel } from \"./SpeakerRecognitionModel.js\";\nimport {\n    VoiceProfile,\n    VoiceProfileType,\n} from \"./Exports.js\";\n\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 */\nexport class SpeakerIdentificationModel implements SpeakerRecognitionModel {\n    private privVoiceProfiles: VoiceProfile[] = [];\n    private privProfileIds: string[] = [];\n\n    private constructor(profiles: VoiceProfile[]) {\n        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 !== 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    public static fromProfiles(profiles: VoiceProfile[]): SpeakerIdentificationModel {\n        return new SpeakerIdentificationModel(profiles);\n    }\n\n    public get voiceProfileIds(): string {\n        return this.privProfileIds.join(\",\");\n    }\n\n    public get profileIds(): string[] {\n        return this.privProfileIds;\n    }\n\n    public get scenario(): string {\n        return \"TextIndependentIdentification\";\n    }\n}\n"]}