AI-901 · Domain 2: Implement AI solutions by using Microsoft Foundry · 58% of the exam
Task 2.2: Implement AI solutions for text and speech by using Foundry
Small apps that analyze text with a model or Azure Language, answer spoken prompts with an audio-capable model, and use Azure Speech for speech to text and text to speech.
Speech to text and text to speech with Azure Speech
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the Microsoft documentation page that proves it.
Question 1 · choose 1
A compliance pipeline processes thousands of customer emails each night. For every email it must record the language as an ISO 639-1 code with a confidence score, in exactly the same output format on every run, so downstream code can parse it. Which approach fits best?
APrompt a general-purpose chat model to name the language of each email
BUse language identification in Azure Speech on each email's text
CCall language detection in Azure Language through the Azure Language SDK
DRun PII detection in Azure Language and read the language from its entity categories
Show the answer and why
APrompt a general-purpose chat model to name the language of each email
Incorrect
A chat model can identify languages, but its wording and formatting can vary from call to call, which makes automated parsing fragile.
BUse language identification in Azure Speech on each email's text
Incorrect
Language identification in Azure Speech works on spoken audio, not on written email text.
CCall language detection in Azure Language through the Azure Language SDK
Correct
Azure Language returns structured, predictable results: the detected language, its ISO 639-1 code and a confidence score between 0 and 1.
DRun PII detection in Azure Language and read the language from its entity categories
Incorrect
PII detection finds personal information such as names and phone numbers. Its categories don't report the language of the text.
General-purpose models are flexible but generate text probabilistically, so results can vary between calls. When an app needs consistent, structured values such as a language code or confidence score, Azure Language's purpose-built analyzers are the better fit.
A team has a Foundry agent that triages support tickets. They want it to use Azure Language features such as named entity recognition and PII detection as tools, without writing REST integration code or managing authentication tokens in the agent. What should they add?
AAdd the Azure Language MCP server from the Foundry Tool Catalog as a tool
BThe Azure Language REST endpoint and key, pasted into the agent's instructions
CThe web search tool, so the agent can find language analysis services online
DA fine-tuned version of the agent's model, trained on labeled support tickets
Show the answer and why
AAdd the Azure Language MCP server from the Foundry Tool Catalog as a tool
Correct
The Azure Language MCP server exposes Language features as tools over the Model Context Protocol. A Foundry resource already includes access to Language, so no separate resource is needed.
BThe Azure Language REST endpoint and key, pasted into the agent's instructions
Incorrect
Instructions are text the model reads, not a tool connection, and putting a key in them exposes a secret.
CThe web search tool, so the agent can find language analysis services online
Incorrect
Web search grounds answers in public web content. It doesn't call Azure Language on the ticket text.
DA fine-tuned version of the agent's model, trained on labeled support tickets
Incorrect
Fine-tuning changes how the model itself responds. It doesn't connect the agent to Azure Language's analyzers.
MCP is an open standard for connecting agents to tools and data. The Azure Language MCP server, available as a remote server in the Foundry Tool Catalog, lets an agent call Language features without custom integration code.
A browser-based language tutor streams a student's microphone audio to a deployed gpt-realtime model and plays the model's spoken replies. The team wants the lowest latency for this client-side app. Which connection method does Microsoft recommend?
AA WebSocket connection from the browser
BA WebRTC connection from the browser
CA SIP trunk connection to a phone system
DFast transcription calls to the REST API
Show the answer and why
AA WebSocket connection from the browser
Incorrect
WebSocket connections suit server-to-server integrations such as backend services. They add latency for a browser client.
BA WebRTC connection from the browser
Correct
WebRTC is recommended for client-side apps such as web and mobile, and gives the lowest latency for real-time audio streaming.
CA SIP trunk connection to a phone system
Incorrect
SIP is for telephony integrations such as call centers and IVR systems, not browser apps.
DFast transcription calls to the REST API
Incorrect
Fast transcription returns the transcript of a recorded file. It can't hold a live, two-way spoken conversation.
The GPT Realtime API supports WebRTC, WebSocket and SIP. For most real-time audio, especially from a browser or mobile client, Microsoft recommends WebRTC for low-latency streaming.
A Python app uses the Speech SDK to transcribe 40-minute recorded lectures from audio files. The developer calls recognize_once_async() and gets back only the first sentence or two of each lecture. What should the developer do?
AUse a SpeechSynthesizer instead of a SpeechRecognizer for the audio files
BTrain a custom speech model with vocabulary taken from the lecture topics
CSet speech_recognition_language to the lecturer's exact locale
DSwitch from recognize-once to continuous recognition for the whole file
Show the answer and why
AUse a SpeechSynthesizer instead of a SpeechRecognizer for the audio files
Incorrect
SpeechSynthesizer produces audio from text. The app needs the opposite.
BTrain a custom speech model with vocabulary taken from the lecture topics
Incorrect
Custom speech improves recognition accuracy for specialized words. It doesn't make a single-utterance call transcribe a whole lecture.
CSet speech_recognition_language to the lecturer's exact locale
Incorrect
Setting the right locale improves accuracy, but recognize-once still stops after the first utterance.
DSwitch from recognize-once to continuous recognition for the whole file
Correct
Recognize-once handles a single utterance of up to about 30 seconds or until silence. Continuous recognition keeps transcribing long audio.
The recognize-once operation transcribes one utterance, up to about 30 seconds or until silence is detected. For longer audio, use continuous recognition and stop it when the file has been processed.
A Python app uses the Speech SDK's SpeechSynthesizer to read order confirmations aloud. The product owner picks a specific standard neural voice from the Voice Gallery. How does the developer make the app use that voice?
ASet speech_recognition_language on the SpeechConfig to the voice's locale
BCall set_speech_synthesis_output_format() with a 24 kHz RIFF format
CSet speech_synthesis_voice_name on the SpeechConfig to that voice
DApply for limited access and train a custom voice for the confirmations
Show the answer and why
ASet speech_recognition_language on the SpeechConfig to the voice's locale
Incorrect
speech_recognition_language sets the language for recognizing spoken input. It doesn't select a voice for synthesis.
BCall set_speech_synthesis_output_format() with a 24 kHz RIFF format
Incorrect
The output format sets the audio file type, sample rate and bit depth. It doesn't choose which voice speaks the text.
CSet speech_synthesis_voice_name on the SpeechConfig to that voice
Correct
The voice name on the SpeechConfig tells the synthesizer which voice to use, and it takes priority over a synthesis language setting.
DApply for limited access and train a custom voice for the confirmations
Incorrect
Custom voice creates a brand-specific voice and requires a limited access application. A standard voice from the gallery needs neither.
Text to speech needs the text to speak and the voice to use. With the Speech SDK, you choose a standard voice by setting its name on the SpeechConfig; the output format only changes how the audio is encoded, and custom voices are a separate, limited access option.
A bank wants a voice assistant for its customers without assembling separate speech to text, language model and text to speech components itself, so it builds on the Voice Live API. Which two capabilities does Voice Live provide as part of the service? (Choose TWO.)
ANoise suppression and echo cancellation on the incoming audio
BWriting the assistant's instructions and choosing which tools it may call
CTraining a custom brand voice without a limited access application
DTranslating statement PDFs into other languages while keeping their layout
EEnd-of-turn and interruption detection, so callers can pause or cut in naturally
Show the answer and why
ANoise suppression and echo cancellation on the incoming audio
Correct
Voice Live includes noise suppression and echo cancellation, so the assistant hears the caller clearly and doesn't pick up its own voice.
BWriting the assistant's instructions and choosing which tools it may call
Incorrect
The developer still defines the assistant's instructions and tools; Voice Live handles the speech experience around them.
CTraining a custom brand voice without a limited access application
Incorrect
Custom voice requires a limited access application; Voice Live doesn't remove that requirement.
DTranslating statement PDFs into other languages while keeping their layout
Incorrect
Translating documents with their formatting is done by document translation in Azure Translator.
EEnd-of-turn and interruption detection, so callers can pause or cut in naturally
Correct
Advanced end-of-turn detection and robust interruption detection are built into Voice Live's conversational features.
Voice Live is a fully managed API that combines speech recognition, generative AI and text to speech in one low-latency interface, with conversational features such as noise suppression, echo cancellation, interruption handling and end-of-turn detection.
A developer is writing a small Python app that uses the Azure Speech SDK to transcribe audio. Which Azure resource provides the endpoint and key that the app's SpeechConfig uses?
AAn Azure AI Search resource
BAn Azure Storage account
CThe Microsoft Foundry resource
DAn Azure Key Vault for secrets
Show the answer and why
AAn Azure AI Search resource
Incorrect
Azure AI Search provides indexing and retrieval, not speech recognition.
BAn Azure Storage account
Incorrect
Storage holds files such as recordings; it doesn't run speech recognition.
CThe Microsoft Foundry resource
Correct
Azure Speech is available through a Foundry resource, whose endpoint and key authenticate the Speech SDK connection.
DAn Azure Key Vault for secrets
Incorrect
Key Vault can store secrets safely, but it isn't the service the SDK connects to.
To use Azure Speech from code, create a Foundry resource and use its endpoint and key, or Microsoft Entra ID, to authenticate the Speech SDK. Azure Speech is one of the Foundry Tools that the resource provides.
An operations engineer wants to transcribe a few audio files with Azure Speech from a command prompt, without writing an application. Which tool fits?
AThe Speech CLI
BThe Azure Language SDK
CThe Speech SDK in a short Python script
DThe fast transcription REST API from a custom client
Show the answer and why
AThe Speech CLI
Correct
The Speech CLI lets you use Azure Speech without writing code, and most Speech SDK features are available in it.
BThe Azure Language SDK
Incorrect
The Language SDK is a code library for text analysis, not audio transcription.
CThe Speech SDK in a short Python script
Incorrect
The Speech SDK transcribes audio, but it's a client library: using it means writing and running application code.
DThe fast transcription REST API from a custom client
Incorrect
Fast transcription returns transcripts quickly, but calling it from a client you build is writing an application.
Azure Speech can be used through the Speech SDK, REST APIs or the Speech CLI. The SDK and REST APIs are for code you write; the CLI is a command-line tool that exposes most SDK features without writing code.
A developer copies the speech-to-speech sample for Voice Live from the Foundry portal into a local Python project. Which package does the app need for the Voice Live client?
Aazure-ai-textanalytics
Bazure-ai-voicelive
Cazure-ai-contentunderstanding
Dazure-cognitiveservices-speech for image input
Show the answer and why
Aazure-ai-textanalytics
Incorrect
That package is the Azure Language client library for text analysis.
Bazure-ai-voicelive
Correct
Python Voice Live applications use the azure-ai-voicelive package, along with packages such as pyaudio and azure-identity.
Cazure-ai-contentunderstanding
Incorrect
That package calls Content Understanding analyzers.
Dazure-cognitiveservices-speech for image input
Incorrect
The Speech SDK handles speech features, and it doesn't take image input.
The Voice Live sample code handles the session, audio devices, streams and interruptions. In Python it relies on the azure-ai-voicelive package, with pyaudio, python-dotenv and azure-identity.
Before writing code, a developer wants to try Azure Speech speech to text and Azure Language features interactively in the new Foundry portal. Where does the portal offer these?
AIn the model leaderboards, which run speech tests on each model
BOn the AI services tab of the Build page's Models section
COn the resource's keys and endpoint page in the Azure portal
DIn the model playground, after deploying a chat model from the catalog
Show the answer and why
AIn the model leaderboards, which run speech tests on each model
Incorrect
Leaderboards compare language models on benchmarks; they don't host service playgrounds.
BOn the AI services tab of the Build page's Models section
Correct
The new portal lists AI services, such as Azure Speech and Azure Language capabilities, for testing on the AI services tab.
COn the resource's keys and endpoint page in the Azure portal
Incorrect
That page shows the key and endpoint your code uses to connect. It isn't in the Foundry portal and offers no interactive testing.
DIn the model playground, after deploying a chat model from the catalog
Incorrect
The model playground tests deployed models with prompts and parameters. Azure Speech and Azure Language are Foundry Tools that the portal offers on the AI services tab.
In the new Foundry portal, the Build page's Models section has an AI services tab with playgrounds for Foundry Tools such as Azure Speech speech to text and text to speech and Azure Language features.