You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the TranslationRecognizer with the AutoDetectSourceLanguage feature here is the initialize of the recognizer :
constv2EndpointInString=`wss://${config.region}.stt.speech.microsoft.com/speech/universal/v2`constv2EndpointUrl=newURL(v2EndpointInString)constspeechConfig=SpeechTranslationConfig.fromEndpoint(v2EndpointUrl,config.key)// Or with// const speechConfig = SpeechTranslationConfig.fromSubscription(config.key, config.region)speechConfig.speechRecognitionLanguage='fr-FR'constautoDetectSourceLanguageConfig=AutoDetectSourceLanguageConfig.fromLanguages(['fr-FR','en-US'])autoDetectSourceLanguageConfig.mode=LanguageIdMode.ContinuousspeechConfig.addTargetLanguage('fr')speechConfig.addTargetLanguage('en')// audioconfig is read from an audio streamconstaudioConfig=AudioConfig.fromStreamInput(audioPushStream)constspeechRecognizer=TranslationRecognizer.FromConfig(speechConfig,autoDetectSourceLanguageConfig,audioConfig)speechRecognizer.recognizing=(sender: Recognizer,event: TranslationRecognitionEventArgs)=>{// The translations object in event.result is undefined}speechRecognizer.startContinuousRecognitionAsync()
Please note on the code above, the this.speechConfig.speechRecognitionLanguage = 'fr-FR' if I don't set this field an error throwIfNullOrUndefined:SpeechServiceConnection_RecoLanguage is thrown.
My problem is that the object that should contains the translations event.result.translations is undefined
But if I don't use the autoDetectSourceLanguageConfig :
constspeechConfig=SpeechTranslationConfig.fromSubscription(config.key,config.region)speechConfig.speechRecognitionLanguage='fr-FR'constautoDetectSourceLanguageConfig=AutoDetectSourceLanguageConfig.fromLanguages(['fr-FR','en-US'])autoDetectSourceLanguageConfig.mode=LanguageIdMode.ContinuousspeechConfig.addTargetLanguage('fr')speechConfig.addTargetLanguage('en')// audioconfig is read from an audio streamconstaudioConfig=AudioConfig.fromStreamInput(audioPushStream)constspeechRecognizer=TranslationRecognizer.FromConfig(speechConfig,autoDetectSourceLanguageConfig,audioConfig)speechRecognizer.recognizing=(sender: Recognizer,event: TranslationRecognitionEventArgs)=>{// I have the translations object with correct translated values}speechRecognizer.startContinuousRecognitionAsync()
Am I doing something wrong ? Is this feature available with Javascript SDK ?
@Richou Thank you for using JS Speech SDK, and writing this issue up. There are a few translation bugs with continuous language id that I've put time into fixing this iteration, and one is the recognizing callback. Our next release, 1.33, due at the end of October, should fix this issue (the merged PR is here.)
If you'd like to give the fix a go before then, either clone the repo and run "npm install && npm pack" to create the binary, or send me an email at <my_username>(at)microsoft(dot)com and I can send you a tar of the current master.
What happened?
I'm trying to use the TranslationRecognizer with the AutoDetectSourceLanguage feature here is the initialize of the recognizer :
Please note on the code above, the
this.speechConfig.speechRecognitionLanguage = 'fr-FR'
if I don't set this field an errorthrowIfNullOrUndefined:SpeechServiceConnection_RecoLanguage
is thrown.My problem is that the object that should contains the translations
event.result.translations
is undefinedBut if I don't use the autoDetectSourceLanguageConfig :
Am I doing something wrong ? Is this feature available with Javascript SDK ?
I got inspired with the code : https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/csharp/sharedcontent/console/translation_samples.cs from the method
TranslationWithMultiLingualFileAsync_withLanguageDetectionEnabled
but translated in typescript/javascript.Platform, Operating System, and Programming Language
Version
1.31.0 (Edge)
What browser/platform are you seeing the problem on?
Node
Relevant log output
No response
The text was updated successfully, but these errors were encountered: