Azure speech service SDK is not working for Javascript

Sayan Dey 0 Reputation points
2024-03-21T06:29:20.04+00:00

I am trying to run the code for finding the Activation Phrases for my Speaker Recognition in Text Independent Identification, but got this error below. This same error also happens when I tried to run Continuous Recognition.

Error : Unable to contact server. StatusCode: 1006, undefined Reason: Unexpected server response: 200

const fs = require("fs");
const SpeechSDK = require("microsoft-cognitiveservices-speech-sdk");


const subscriptionKey = 'MY_SPECIAL_KEY';
const region = 'eastus';
const locale = 'en-US'

const speechConfig = SpeechSDK.SpeechConfig.fromSubscription(
    subscriptionKey,
    region
);

speechConfig.setProperty(
    SpeechSDK.PropertyId.SpeechServiceConnection_TranslationVoice,
    locale
);


const getActivationPhrases = async () => {
    const voiceProfClient = new SpeechSDK.VoiceProfileClient(speechConfig);
    try {
            let result = await voiceProfClient.getActivationPhrasesAsync(
                SpeechSDK.VoiceProfileType.TextIndependentIdentification,
                locale
            );
            if (result.phrases.length > 0) {
                for (let phrase of result.phrases)
                    console.log(phrase)
            }
        } catch (err) {
            console.log(err);
            console.log(`Error : ${err}`)
        }
}
Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,384 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,357 questions
{count} votes

1 answer

Sort by: Most helpful
  1. navba-MSFT 16,935 Reputation points Microsoft Employee
    2024-03-25T04:10:49.58+00:00

    @Sayan Dey Could you please confirm if you have registered for Speaker Recognition access as described at https://learn.microsoft.com/en-us/legal/cognitive-services/speech-service/speaker-recognition/limited-access-speaker-recognition ? Awaiting your reply.

    0 comments No comments