← Develop AI Apps and Agents o… Latent Shelf · Ch.22

Module Study Guide · Path 3 · Natural language

Translate Text and Speech with Microsoft Foundry Tools

An LLM can translate a sentence; a production translation solution wants 90+ languages, custom models, and speech that comes out already spoken.

— the module's case

Dedicated translation. This module covers why specialized services beat general LLMs for translation, Azure Translator for text and documents, and Azure Speech translation for spoken input — to text or to synthesized speech.

90+ languagesTranslatorspeech translation14 quiz questions
01Why specialized

Two translation services in Foundry

LLMs can generate output in many languages and do basic translation, but comprehensive, production-grade solutions want purpose-built models. Foundry offers two, both reached through the resource endpoint.

The two translation services.
ServiceWhat it does
Azure Translator in Foundry ToolsComprehensive text translation — a wide range of languages, plus custom translation models.
Azure Speech in Foundry ToolsSpeech translation — speech-to-text and speech-to-speech, across multiple languages at once.
02Azure Translator

Text and documents, 90+ languages

Azure Translator translates text between 90+ languages via API. Its capabilities: text translation (default or LLM-based models), document translation (sync or async, preserving structure), custom models for domain terminology, and transliteration (converting between scripts, e.g. Hiragana → Latin).

Key concept · Calling the Translator

Authenticate a TextTranslationClient with an AzureKeyCredential and the Foundry endpoint (or a region). Key methods: get supported languages (137+ languages with names/ISO codes), translate text (a list of InputTextItem; the from_language is optional — it auto-detects — and you can target several languages at once, getting back the detected source plus each translation), and transliterate (using from_script and to_script, e.g. "Jpan"→"Latn"). The portal has playgrounds to compare the default model against LLM results and to generate client code.

03Speech translation

Spoken input, spoken output

Azure Speech translation uses a SpeechTranslationConfig — set speech_recognition_language for the source and add_target_language() for each target — with an AudioConfig (e.g. the microphone). A TranslationRecognizer then translates spoken input into text for every target language at once.

Key concept · Two ways to get spoken output

Manual synthesis — translate to text with the TranslationRecognizer, then synthesize each translation with a SpeechSynthesizer and language-specific voices; the flexible choice for multi-language output. Event-based synthesis — set voice_name on the config and handle the recognizer's synthesizing event to read evt.result.audio directly; simpler, but limited to 1:1 (single source → single target). Both let you pick neural voices for natural pronunciation.

★Test yourself

Chapter 22 quiz

Fourteen questions on service choice, Azure Translator, and speech translation. Answer first, then expand Show answer.

Part A · Multiple choice

Q1

Which service handles comprehensive text and document translation?

  • A Azure Translator in Foundry Tools
  • B Azure Speech in Foundry Tools
  • C Azure Language
  • D Sora
Show answer

A — Azure Translator. Speech handles spoken translation.

Q2

Roughly how many languages does Azure Translator support?

  • A 5
  • B 90+
  • C Exactly 12
  • D 1,000+
Show answer

B — 90+. (The supported-languages call lists 137+ entries.)

Q3

What is transliteration?

  • A Converting text between scripts (e.g. Hiragana → Latin)
  • B Translating speech to text
  • C Summarizing a document
  • D Detecting PII
Show answer

A. Using from_script and to_script.

Q4

If you omit from_language when translating text, what happens?

  • A The source language is auto-detected
  • B The call fails
  • C It defaults to English
  • D It returns the input unchanged
Show answer

A. The response also reports the detected source.

Q5

Which object configures source and target languages for speech translation?

  • A SpeechTranslationConfig
  • B TextTranslationClient
  • C MCPTool
  • D AIProjectClient
Show answer

A. speech_recognition_language + add_target_language().

Q6

Which synthesis approach supports multi-language spoken output?

  • A Manual synthesis (TranslationRecognizer → SpeechSynthesizer)
  • B Event-based synthesis
  • C Neither
  • D Both equally
Show answer

A. Event-based synthesis is limited to 1:1.

Part B · True or false

Q7

General LLMs are the recommended tool for production-grade, multi-language translation.

Show answer

False. Specialized services (Translator, Speech) are designed for that.

Q8

Document translation can preserve the document's structure.

Show answer

True. Sync or async, maintaining structure.

Q9

A TranslationRecognizer can translate spoken input into several target languages at once.

Show answer

True. Add multiple target languages to the config.

Q10

Event-based speech synthesis works for many target languages simultaneously.

Show answer

False. It's for 1:1 (single source → single target) only.

Q11

Azure Translator supports custom, domain-specific translation models.

Show answer

True. For specialized terminology.

Part C · Short answer

Q12

Name the four capabilities of Azure Translator.

Show answer

Text translation, document translation, custom models, and transliteration.

Q13

Which credential and client translate text in code?

Show answer

AzureKeyCredential with a TextTranslationClient (Foundry endpoint or region).

Q14

In event-based synthesis, how do you retrieve the translated audio?

Show answer

Set voice_name, handle the recognizer's synthesizing event, and read evt.result.audio.