Click here to Skip to main content
14,039,045 members
Rate this:
 
Please Sign up or sign in to vote.
Hi . I am a student doing a voice-related project with c#.

I already used Azure Bing Speech API and Google Cloud Speech API to get people's voice as text.

But I also need Azure Speaker Recognition API to identify and verify individual speaker using voice.

However, there aren't many information about this API even though Google Searching. And Azure site(especially, part that identify and verify speaker using wav file containing the user's voice) is so simple..
so I can't know how to load wav file to identify and verify speaker in c# code.

Have you used the Azure Speaker Recognition API?

Please. Help me.

What I have tried:

following is sample code on the Azure Site.
https://westus.dev.cognitive.microsoft.com/docs/services/563309b6778daf02acc0a508/operations/5645c725ca73070ee8845bd6

static async void MakeRequest()
{
var client = new HttpClient();
var queryString = HttpUtility.ParseQueryString(string.Empty);

// Request headers
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "subscription-key");
// Request parameters
queryString["shortAudio"] = "true";
var uri = "https://westus.api.cognitive.microsoft.com/spid/v1.0/identify?identificationProfileIds={identificationProfileIds}&" + queryString;

HttpResponseMessage response;

// Request body
byte[] byteData = Encoding.UTF8.GetBytes("{body}");

using (var content = new ByteArrayContent(byteData))
{
content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
response = await client.PostAsync(uri, content);

}

}
Posted
Updated 15-Mar-19 9:39am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

   
Comments
Member 13239997 11-Jan-18 9:34am
   
yes I have. But It is about to Speech Recognition , but I want to know about Speaker Recognition.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Use something else. Microsoft has no code for this and I believe it is a dead end. I have been looking for a good example for 3 years, to no avail.

Maybe try AWS. The Alexa has bulldozed anything from MS, Apple, and Google. AWS has got to have MUCH better APIs. I am checking this right now.
   
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

I suspect the bit you're having the problem with is the fact that you seem to think that the {body} part literally means that's what you put in. What you should be encoding here is the actual audio that you want to transfer over to the API. Don't forget to properly set the parameters such as the identification profile, the code sample there isn't meant to be used "as is".
   
Comments
Member 13239997 14-Jan-18 2:59am
   
Yes. That code is just sample code from the Azure site.
And I eventually used the Speaker Recognition API.
I read the readme on https://github.com/Microsoft/Cognitive-SpeakerRecognition-Windows and applied the example.
thank you.
Member 13860438 8-Jun-18 2:57am
   
How do you add the audio file in the body part? And what other changes have to be made in the code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.190425.1 | Last Updated 15 Mar 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100