Coder Social home page Coder Social logo

Comments (8)

rhurey avatar rhurey commented on May 22, 2024 1

The data type for the endpoint isn't of the expected type.

fromEndPoint is defined as:
public static fromEndpoint(endpoint: URL, subscriptionKey: string): SpeechConfig

So in this case, you'd want something like: (node)
var URL = require('url').URL;
let speechConfig = sdk.SpeechConfig.fromEndpoint(new URL (wss://${SERVICE_REGION}.stt.speech.microsoft.com/speech/recognition/dictation/cognitiveservices/v1), SUBSCRIPTION_KEY);

The SDK's parameter check at that point was only for null on the passed in parameter, it didn't type check the parameter or the .href property it used. I'll put a bug in our backlog to tighten the parameter check and get a better error message out.

Hope that helps.

from cognitive-services-speech-sdk-js.

orgads avatar orgads commented on May 22, 2024

ping?

from cognitive-services-speech-sdk-js.

wolfma61 avatar wolfma61 commented on May 22, 2024

currently not possible by setting a property. We are going to try to address this in an upcoming release.

as a work-around you can create the recognizer fromEndpoint
https://docs.microsoft.com/en-us/javascript/api/microsoft-cognitiveservices-speech-sdk/speechconfig?view=azure-node-latest#fromendpoint-url--string-

the URL should look similar to this:

wss://.stt.speech.microsoft.com/speech/recognition/dictation/cognitiveservices/v1

from cognitive-services-speech-sdk-js.

orgads avatar orgads commented on May 22, 2024

Thank you. I'll try it.

from cognitive-services-speech-sdk-js.

geooot avatar geooot commented on May 22, 2024

Hello!
I am trying to use dictation mode as well and this is how I setup the speechConfig using the workaround. It worked using fromSubscription, but doesn't work using fromEndpoint. I am kind of guessing on how the url should be formatted as I have not found a reference to a websocket url in the azure portal.
If you could see what I am doing wrong, help would be much appreciated

// now create the audio-config pointing to our stream and
// the speech config specifying the language.
let audioConfig = sdk.AudioConfig.fromStreamInput(pushStream);
// let speechConfig = sdk.SpeechConfig.fromSubscription(SUBSCRIPTION_KEY, SERVICE_REGION);
let speechConfig = sdk.SpeechConfig.fromEndpoint(`wss://${SERVICE_REGION}.stt.speech.microsoft.com/speech/recognition/dictation/cognitiveservices/v1`, SUBSCRIPTION_KEY);

// setting the recognition language to English.
speechConfig.speechRecognitionLanguage = LANG;

// create the speech recognizer.
let recognizer = new sdk.SpeechRecognizer(speechConfig, audioConfig);

from cognitive-services-speech-sdk-js.

orgads avatar orgads commented on May 22, 2024

I've noticed that fromEndpoint uses subscription key. Is there an alternative that accepts token (and still enabled dictation mode)? I want to avoid issueToken for each client.

from cognitive-services-speech-sdk-js.

rhurey avatar rhurey commented on May 22, 2024

You should be able to pass in any value you want for the subscription key passed to fromEnedPoint and then call recognizer.authorizationToken = and the token will be used instead of the subscription key.

from cognitive-services-speech-sdk-js.

rhurey avatar rhurey commented on May 22, 2024

enableDictation was added to the SpeechConfig object in the 1.7.0 release.

from cognitive-services-speech-sdk-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.