question

PerMalmstedt-7952 avatar image
0 Votes"
PerMalmstedt-7952 asked LucVoVan-4787 edited

CognitiveServices EnrollProfileAsync returns error 404 Resource not found

Hi!
I am trying out VoiceProfile enrollment on CognitiveServices in C# via Microsoft.CognitiveServices.Speech.csharp library.
The speech to text part (SpeechRecognizer) works excellent, but when I try to use Voice Profile enrollment (client.EnrollProfileAsync) it returns error 404 "Resource not found" every time.
This is my test code:

     public static async Task<VoiceProfile> VerificationEnroll(string filename, string name)
     {
         try
         {
             SpeechConfig config = SpeechConfig.FromSubscription("<MY_KEY_HERE>", "westus");
             var profileMapping = new Dictionary<string, string>();

             using (var client = new VoiceProfileClient(config))
             using (var profile = await client.CreateProfileAsync(VoiceProfileType.TextIndependentVerification, "en-us"))
             {
                 using (var audioInput = AudioConfig.FromWavFileInput(filename))
                 {
                     Console.WriteLine($"Enrolling profile id {profile.Id}.");
                     // give the profile a human-readable display name
                     profileMapping.Add(profile.Id, name);

                     VoiceProfileEnrollmentResult result = null;
                     result = await client.EnrollProfileAsync(profile, audioInput);

                     if (result.Reason == ResultReason.EnrolledVoiceProfile)
                     {
                         await SpeakerVerify(config, profile, profileMapping);
                     }
                     else if (result.Reason == ResultReason.Canceled)
                     {
                         var cancellation = VoiceProfileEnrollmentCancellationDetails.FromResult(result);
                         Console.WriteLine($"CANCELED {profile.Id}: ErrorCode={cancellation.ErrorCode} ErrorDetails={cancellation.ErrorDetails}");
                     }
                 }
                 return profile;
             }
         }
         catch (Exception ex)
         {
             return null;
         }
     }

I have understood that Voice profiling is only supported in westus region. As I am in Northern Europe, my first guess was that because my Azure resource was created for north europe, that was the issue. So I have created a separate resource to run these tests in westus region, but without any luck.
Anyone has any ideas what the issue is?

BR
Per

azure-cognitive-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YutongTie-MSFT avatar image
0 Votes"
YutongTie-MSFT answered YutongTie-MSFT edited

Hello,

Thanks for reaching out to us here. I just tried on my side and there is no issue. I am in westus region, tier S0. The sample repo I am using is https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/quickstart/csharp/dotnet/speaker-recognition Could you please have a try?

103662-image.png


Regards,
Yutong


image.png (72.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PerMalmstedt-7952 avatar image
0 Votes"
PerMalmstedt-7952 answered

Dear Yutong
Thank you so much for fast response to my issue!
Unfortunately I get the same result with the example code.
ResultReason.Cancelled.
ErrorDetails=Resource not found Internal service error (404)

So my guess is that it is not in my code, but has something to do with my Azure Resource?
Or could it be something missing in my setup? But as the code for speech to text works fine, I am assuming that I have what I need installed.


103765-screenduimp.gif



screenduimp.gif (89.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YutongTie-MSFT avatar image
0 Votes"
YutongTie-MSFT answered

Hello @PerMalmstedt-7952

I don't have any special setup in my end. But I did find something when I reproduced this error.

I saw your resource is Cognitive Service all in one resource. When I created this and tried, I have the same 404 error as yours.
105651-image.png

Then I created a new "Speech Service" resource, all errors gone and it worked for me.
105661-image.png

Please select below resource type, this issue should be fixed.
speech-search.png
Could you please try on your end and let me know if you still have trouble on it? Thank you!


Regards,
Yutong



image.png (54.5 KiB)
image.png (71.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LucVoVan-4787 avatar image
0 Votes"
LucVoVan-4787 answered LucVoVan-4787 edited

Please note that at the time of the writing, this service is currently only available in the West US region. If using another region you will get the 404 error. You can see this here on the Products available by Region page.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.