question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception with an error code: 0x5 (SPXERR_INVALID_ARG) or 0x21 (SPXERR_INVALID_HANDLE) when trying to Enroll a VoiceProfile for Speaker Identification

See original GitHub issue

Hi I’m getting the following errors when trying to Enroll a voice profile for speaker identification and the error changes between versions 1.12.1. and 1.13.0

The profile has been checked and is an Identification profile , and exists.

The error occurs when i call result = await client.EnrollProfileAsync(profile, audioConfig);

I am trying to create the profile, then enroll later… When i create a voiceprofile to pass into the enrollment like this

var profile = new VoiceProfile(profileId)

…rather than creating one with the client seems to be triggering the error. , Does the Enrollment need the profile creating just before? I cannot see a client method for retrieving a created voiceprofile.

Expected behaviour Enrollment occurs or a more meaningful error message is displayed

Environment Using the windows version of SDK OS: windows 10 Version 10.0.18363 Build 18363 Programming language: C# in a project targeting netstandard2.0 Tried enrolling using microphone and wav files and get the same errors. App: Winforms

Version: Microsoft.CognitiveServices.Speech SDK 1.12.1

Error Exception with an error code: 0x5 (SPXERR_INVALID_ARG) Source Microsoft.CognitiveServices.Speech.csharp

Stack trace at Microsoft.CognitiveServices.Speech.Internal.SpxExceptionThrower.ThrowIfFail(IntPtr hr) at Microsoft.CognitiveServices.Speech.Internal.SpxFactory.GetDataFromHandleUsingDelegate(GetResultDelegate functionPtr, InteropSafeHandle handle, Int32 maxCharCount) at Microsoft.CognitiveServices.Speech.VoiceProfileEnrollmentResult…ctor(IntPtr resultHandlePtr) at Microsoft.CognitiveServices.Speech.VoiceProfileClient.<>c__DisplayClass6_0.b__0(InteropSafeHandle h) at Microsoft.CognitiveServices.Speech.VoiceProfileClient.<>c__DisplayClass10_01.<RunAsync>b__0() at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Ossa.VoiceIdentification.Common.SpeechWrapper.<Enroll_TextIndependentVerification>d__19.MoveNext() in C:\Projects\VoiceIdentification\src\Ossa.VoiceIdentification.Common\SpeechWrapper.cs:line 269 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Ossa.VoiceIdentification.WindowsClient.Form1.<btnEnrollMicTextIndependant_Click>d__19.MoveNext() in C:\Projects\VoiceIdentification\src\Ossa.VoiceIdentification.WindowsClient\Form1.cs:line 181 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

If I update to Version: Microsoft.CognitiveServices.Speech SDK 1.13.0 I get the following error

‘Exception with an error code: 0x21 (SPXERR_INVALID_HANDLE)’

  at Microsoft.CognitiveServices.Speech.Internal.SpxExceptionThrower.ThrowIfFail(IntPtr hr)

at Microsoft.CognitiveServices.Speech.Internal.SpxFactory.GetDataFromHandleUsingDelegate(GetResultDelegate functionPtr, InteropSafeHandle handle, Int32 maxCharCount) at Microsoft.CognitiveServices.Speech.VoiceProfileEnrollmentResult…ctor(IntPtr resultHandlePtr) at Microsoft.CognitiveServices.Speech.VoiceProfileClient.<>c__DisplayClass6_0.<EnrollProfileAsync>b__0(InteropSafeHandle h) at Microsoft.CognitiveServices.Speech.VoiceProfileClient.<>c__DisplayClass10_01.<RunAsync>b__0() at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() at Ossa.VoiceIdentification.Common.SpeechWrapper.<Enroll_TextDepenentVerification>d__18.MoveNext() in C:\Projects\VoiceIdentification\src\Ossa.VoiceIdentification.Common\SpeechWrapper.cs:line 243 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Ossa.VoiceIdentification.WindowsClient.Form1.<btnEnrollMic_Click>d__15.MoveNext() in C:\Projects\VoiceIdentification\src\Ossa.VoiceIdentification.WindowsClient\Form1.cs:line 127

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
chrisbasoglucommented, Sep 9, 2020

in approximately 3-4 weeks.

1reaction
lisaweixucommented, Jan 29, 2021

The fixes is in the latest release of SDK. The latest version is 1.15.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Cognitive Services Speaker Identification problem ...
Hi all, I am trying out Azure's Speaker Identification (and also Verification). I was able to Enroll with all VoiceProfileTypes speakers, ...
Read more >
Problem with Cognitive Services Speaker Recognition
Tried your code unchanged and got the following error : This exception was originally thrown at this call stack: [External Code] SpeakerRecog.
Read more >
Speaker enrollment
Speaker enrollment is the process by which an identity becomes associated with a voice or accoustic signature. This allows RingCentral to ...
Read more >
2020 Update! Microsoft Cognitive Services Speaker ...
In this article I'll show the same web page implementation, but use the updated 2020 Speaker Recognition APIs, and introduce the new ...
Read more >
Speaker verification - VoiceAI Connect
VoiceAI Connect sends the information to the verification service and returns the speaker ID status (enrolled true/false) to the bot. Example of a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found