How to use Autodetect language in speech translation using javascript SDK.

Alex 0 Reputation points
2024-07-31T11:35:55.25+00:00

Is Autodetect language feature available in speech translation for javascript SDK? If it is available can you help me with entire code and steps on how to configure and run it so that instead of mentioning my source language it will automatically detects the language and translate it to my target language.

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,779 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VasaviLankipalle-MSFT 17,646 Reputation points
    2024-07-31T21:09:25.8066667+00:00

    Hello @Alex , Thanks for using Microsoft Q&A Platform.

    Language identification (LID) with Speech translation can be used when you need to identify the language in an audio source and then translate it to another language.

    Have you tried, Speech translation with language identification? This is only supported with Speech SDKs in C#, C++, JavaScript, and Python.

    Otherwise, to identify one of multiple languages that might be spoken you can use the AutoDetectSourceLanguageConfig object: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-identification?tabs=once&pivots=programming-language-javascript#candidate-languages

    var autoDetectSourceLanguageConfig = SpeechSDK.AutoDetectSourceLanguageConfig.fromLanguages([("en-US", "de-DE", "zh-CN"]);
    
    0 comments No comments

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.