Translate Speech With Azure AI Speech Service

 





Introduction

By identifying and recording spoken input in a designated language and providing translations of the transcription in one or more other languages, translation of speech expands upon speech recognition.

Provision an Azure Resource For Speech Translation

The Azure AI Speech service offers comprehensive speech translation capabilities powered by machine learning and artificial intelligence, allowing developers to integrate real-time, end-to-end speech translation into their applications or services. You have the option to utilize either a dedicated Azure AI Speech resource or a multi-service Azure AI Services resource.

Before you can use the service, you need to create an Azure AI Speech resource in your Azure subscription. After creating your Azure resource, you will need the following information to use it from a client application through one of the supported SDKs:

  • The location in which the resource is deployed

  • One of the keys assigned to your resource.

You can view of these values on the Keys and Endpoint page for your resource in the Azure portal.

Translate Speech To Text

The approach for speech translation utilizing the Azure AI Speech SDK is akin to that of speech recognition, but it includes details regarding the source and target languages for the translation:

  • Use a SpeechTranslationConfig object to encapsulate the information required to connect to your Azure AI Speech resource. Specifically, its location and key.

  • The SpeechTranslationConfig object is also used to specify the speech recognition language (the language in which the input speech is spoken) and the target languages into which it should be translated.

  • Optionally, use an AudioConfig to define the input source for the audio to be transcribed. By default, this is the default system microphone, but you can also specify an audio file.

  • Use the SpeechTranslationConfig, and AudioConfig to create a TranslationRecognizer object. This object is a proxy client for the Azure AI Speech translation API.

  • Use the methods of the TranslationRecognizer object to call the underlying API functions. For example, the RecognizeOnceAsync() method uses the Azure AI Speech service to asynchronously translate a single spoken utterance.

  • Process the response from Azure AI Speech. In the case of the RecognizeOnceAsync() method, the result is a SpeechRecognitionResult object that includes Duration, OffsetInTicks, Properties, Reason, ResultId, Text, Translations.

If the operation was performed successfully, the Reason property will have the value RecognizedSpeech from the enumeration, and the Text property will hold the transcription in its original language. Additionally, there is a Translations property available, which holds a dictionary of translations, with two-character ISO language codes (like "en" for English) used as keys.

Conclusion

We have successfully learnt about the basics of speech to text translation.
















Comments

Popular posts from this blog

Connect Data to Azure Sentinel Using Data Connectors

Azure AI Search plugin in Microsoft Security Copilot (Preview)

Information Protection Scanner: Resolve Issues with Information Protection Scanner Deployment