Real time speaker diarization error with Azure SDK

Rohit Shetty 0 Reputation points

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,141 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
1,870 questions
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 9,150 Reputation points Microsoft Employee

    @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:

      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.

    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.

    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:

    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.