Real time speaker diarization error with Azure SDK

Rohit Shetty 0 Reputation points
2023-11-05T02:00:06.5366667+00:00

the real-time speaker diarization is working for audio files fine. But when we try to take the input as microphone it works in python but our codebase is in typescript (a type of js) and it does not work in either js or ts for us. What can ethe issue we have tried several ways to do it . Right now the code looks like this but the speaker id comes as undefined everytime. Sample of initializing the speech service -- const audioConfig = sdk.AudioConfig.fromDefaultMicrophoneInput() console.log(audioConfig) const speechConfig = sdk.SpeechConfig.fromSubscription(subscriptionKey, region); speechConfig.speechRecognitionLanguage = language; speechConfig.setProperty(sdk.PropertyId.SpeechServiceConnection_SpeakerIdMode, "true")


Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,713 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,833 questions
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 24,260 Reputation points Microsoft Employee
    2023-11-06T04:34:15.4733333+00:00

    @Rohit Shetty Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    It seems like you are trying to use the Microsoft Azure Speech Services SDK to perform real-time speaker diarization using the microphone as input, but you are encountering issues with TypeScript and JavaScript.

    Please follow the below action plan:

    1.Please refer the below article for the speech diarization:
    https://learn.microsoft.com/en-us/azure/ai-services/speech-service/get-started-stt-diarization?tabs=macos&pivots=programming-language-javascript

      var audioConfig = SpeechSDK.AudioConfig.fromDefaultMicrophoneInput();
    

    2.Instead of leaving the parameter blank, Please enter the deviceId parameter for fromMicrophoneInput and check if that works.
    User's image

    More Info here.

    3.Also check for the SDK installation guide for required version. https://learn.microsoft.com/en-us/azure/ai-services/speech-service/quickstarts/setup-platform?pivots=programming-language-javascript

    4.Ensure that your SDK is up to date and is using latest version and you are not using older version of the SDK.

    5.Check if the microphone is properly connected and configured on your system. Ensure that you have the necessary permissions and access rights to use the microphone as input.

    User's image

    6.Please use the sample code available here and check if that works fine.

    If you still encounter the same issue, please let me know. I would be happy to help.

    **
    --------****Update:--------
    On a side note:** As of today, recognizing speech from a microphone is not supported in Node.js. It's supported only in a browser-based JavaScript environment. For more information, see the React sample and the implementation of speech to text from a microphone on GitHub.

    The React sample shows design patterns for the exchange and management of authentication tokens. It also shows the capture of audio from a microphone or file for speech to text conversions.

    Sharing some relevant articles if that helps:
    https://learn.microsoft.com/en-us/answers/questions/1349902/real-time-diarization-with-defaultmicrophone-input
    https://stackoverflow.com/questions/67925253/azure-cognitive-services-speech-to-text-microphone-not-detected
    https://stackoverflow.com/questions/58084122/microsoft-speech-recognition-nodejs

    Hope this helps.

    **
    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


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.