Getting exception when deploy Speech SDK on Azure webapp SPXERR_MIC_NOT_AVAILABLE

sam 201 Reputation points
2021-08-20T05:31:49.707+00:00

Describe the bug
When I am trying to deplpy my Speech SDK (from Microphone To Speech)on Azure webapp getting SPXERR_MIC_NOT_AVAILABLE though it is working locally and over local iis deployed also.

To Reproduce
Steps to reproduce the behavior:
Write below method on .net core api and deploy on Azure

public async Task<IActionResult> MicrophoneToSpeechAsync(string languageIso6391Code)  
{  
    var subscription = _config.GetValue<string>("SubscriptionId");  
    var location = _config.GetValue<string>("Region");  
    var config = SpeechConfig.FromSubscription(subscription, location);  
    config.SpeechRecognitionLanguage = string.IsNullOrWhiteSpace(languageIso6391Code) ? "en-us" :   
    languageIso6391Code;  

    // Creates a speech recognizer.  
    using (var recognizer = new SpeechRecognizer(config))  
    {  
        Console.WriteLine("Say something...");  
        var result = await recognizer.RecognizeOnceAsync();  
        List<SpeechCommonService.DetectedLanguage> language = null;  
        // Checks result.  
        if (result.Reason == ResultReason.RecognizedSpeech)  
        {  
            Console.WriteLine($"We recognized: {result.Text}");  
       
        }  
    }  

}

Extected behaviour
It should understand the spoken words over microphone and convert it to text.

124855-error1.png

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,675 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,663 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.