Microsoft Speech Recognition

Starman 0 Reputation points
2024-02-14T02:05:33.0233333+00:00

When I run my code, the Azure speech recognition API is canceled abruptly before any text is recognized. Another user has posted this problem before. I'm not sure if this is a firewall thing or not; I'm very new to using Azure and its speech technology. The API through the system environment variable should work and I'm on a stable connection. Maybe I have to set something up through Speech Azure? I have a school and personal account so does the API have to match up with whatever account I use on VS? I'm lost. There is a lot of new for me here so sorry if I am misinformed when answering back questions. [system is windows 10 / azure-cognitiveservices-speech is installed / i have not exceeded any audio tiers thru azure]

CLOSING speech recognition on SpeechRecognitionCanceledEventArgs(session_id=5cfec5e54e3f4778a7fff1ebc3fc9107, result=SpeechRecognitionResult(result_id=53718a3138524df494f543c3e4f2ca14, text="", reason=ResultReason.Canceled)) CLOSING speech recognition on SessionEventArgs(session_id=5cfec5e54e3f4778a7fff1ebc3fc9107)

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 27,605 Reputation points Microsoft Employee Moderator
    2024-02-14T05:59:59.8666667+00:00

    @Starman Thanks for getting back.

    Since the requirement here is to convert the speech to text while taking the input from microphone, You can leverage the sample provided here:

    https://learn.microsoft.com/en-us/azure/ai-services/speech-service/get-started-speech-to-text?tabs=linux%2Cterminal&pivots=programming-language-python#recognize-speech-from-a-microphone

    Please refer the function recognize_from_microphone().

    Also note that this github code which you shared https://github.com/DougDougGithub/Babagaboosh is open source, so if you are facing any issues, you should report it under its issue section.

    If you feel its related to the proxy / firewall, as an isolation step, try to bypass it or test your application from a different network and see if that works.

    If you cannot bypass your proxy, then you can use the SpeechConfig SetProxy() call and add the proxy details in your application:
    https://learn.microsoft.com/en-us/cpp/cognitive-services/speech/speechconfig#setproxy

    Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.

    0 comments No comments

Your answer

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