示例#1
0
        public async Task <string> SpeakerVerification([FromBody] VerifySpeaker verifySpeaker)
        {
            var sb = new StringBuilder();

            try
            {
                // Create the service
                Console.WriteLine("Creating the Speaker Verification Service.");
                var svService = new SpeakerVerificationService(Constants.SPEAKER_RECOGNITION_KEY);
                Console.WriteLine("Done");
                Console.WriteLine("");

                //Delete all existing profiles
                //Console.WriteLine("Deleting All Existing Profiles.");
                //svService.DeleteAllProfiles().Wait();
                //Console.WriteLine("Done");
                //Console.WriteLine("");



                // Verify Speaker
                string obj = await SpeakerVerificationMethods.SVVerifySpeaker(svService, verifySpeaker);

                sb.AppendLine($"obj: {obj}");
                return(sb.ToString());
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: " + ex.Message);
                return(ex.Message.ToString());
            }
        }
示例#2
0
        public Dictionary <string, Guid> EnrollSpeaker([FromBody] EnrollSpeaker enrollSpeaker)
        {
            var sb = new StringBuilder();

            // Create the service
            Console.WriteLine("Creating the Speaker Verification Service.");
            var svService = new SpeakerVerificationService(Constants.SPEAKER_RECOGNITION_KEY);

            Console.WriteLine("Done");
            Console.WriteLine("");

            // Enroll Speaker
            var output = new Dictionary <string, Guid>();

            output["guid"] = SpeakerVerificationMethods.SVEnrollSpeaker(svService, enrollSpeaker);
            return(output);
        }
示例#3
0
        public Dictionary <string, string> DeleteSpeakers()
        {
            // Create the service
            Console.WriteLine("Creating the Speaker Verification Service.");
            var svService = new SpeakerVerificationService(Constants.SPEAKER_RECOGNITION_KEY);

            Console.WriteLine("Done");
            Console.WriteLine("");

            //Delete all existing profiles
            Console.WriteLine("Deleting All Existing Profiles.");
            svService.DeleteAllProfiles().Wait();
            Console.WriteLine("Done");
            Console.WriteLine("");
            var obj = new Dictionary <string, string>();

            obj["OK"] = "Profiles Deleted";
            return(obj);
        }