question

PranamK-0159 avatar image
1 Vote"
PranamK-0159 asked Viorel-1 answered

Mic not detecting. Getting Unhandled exception (Exception with an error code: 0xe (SPXERR_MIC_NOT_AVAILABLE))

I have been executing code as per Microsoft Learn :

https://docs.microsoft.com/en-us/learn/modules/transcribe-speech-input-text/7-optional-exercise-listen-incoming-data?pivots=csharp

  • My Earphone/Audio is totally fine.

  • I'm using Visual Studio Code.

Whenever I run this code, I'm getting error :

$ dotnet run
Begin speaking....
Unhandled exception. System.AggregateException: One or more errors occurred. (Exception with an error code: 0xe (SPXERR_MIC_NOT_AVAILABLE))
---> System.ApplicationException: Exception with an error code: 0xe (SPXERR_MIC_NOT_AVAILABLE)
at Microsoft.CognitiveServices.Speech.Internal.SpxExceptionThrower.ThrowIfFail(IntPtr hr)
at Microsoft.CognitiveServices.Speech.Recognizer.FromConfig(GetRecognizerFromConfigDelegate fromConfig, SpeechConfig speechConfig)
at Microsoft.CognitiveServices.Speech.SpeechRecognizer..ctor(SpeechConfig speechConfig)
at helloworld.Program.RecognizeSpeechAsync() in C:\Users\Indhu\Desktop\Convert-Audio-From-Microphone\Program.cs:line 18
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at helloworld.Program.Main() in C:\Users\Indhu\Desktop\Convert-Audio-From-Microphone\Program.cs:line 48






Code : (I have attached. Rename it to Program.cs)78520-program.txt






dotnet-csharpazure-speechdotnet-cli
program.txt (1.9 KiB)
· 1
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.

Hi @PranamK-0159 , welcome to Microsoft Q&A forum. It seems you are using Visual Studio Code, since our forum(Microsoft Q&A vs-general) is about the usage of tools and editors in Visual Studio, for VS Code related questions(Technical Support), I suggest you post your questions on Stack Overflow tagged with Visual Studio Code.


0 Votes 0 ·

1 Answer

Viorel-1 avatar image
0 Votes"
Viorel-1 answered

According to some similar problems, check if your microphone is available using other programs, such as Windows Voice Recorder, for example.

You can also check and debug your code using Visual Studio.

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.