Text and speech solutions
Add text analysis to an app with Azure Language, answer spoken prompts with a multimodal model, and build speech features with Azure Speech in Foundry Tools.
In this lesson you'll learn
- Calling text analysis features from an app
- Sending audio to a multimodal model and getting a spoken or written answer
- Speech to text, text to speech and SSML with Azure Speech
- Choosing between a multimodal model and the Speech service
1. Text analysis in an app
New to text analysis? Start here
Text analysis means asking AI to find things in text: what language it's in, how people feel, which names and places appear, and what the main points are. You can do this with ready-made Azure Language features or by prompting a generative model.
Azure Language in Foundry Tools offers ready-made features: language detection, sentiment analysis (with opinion mining), key phrase extraction, named entity recognition, PII detection and redaction, and summarisation. An app sends text to the endpoint of your Foundry resource and gets structured JSON back.
| Approach | Choose when |
|---|---|
| Azure Language features | You need consistent, structured results at scale, such as sentiment scores for every review |
| A generative model with a prompt | You need flexible analysis, such as "list the three biggest complaints in plain English" |
2. Responding to spoken prompts with a multimodal model
Some models accept audio as input and can reply with text or speech. Your app sends the recorded question as audio, and the model understands it directly, without a separate transcription step. For live, low-latency voice conversations, Foundry offers real-time voice options such as the Voice Live API and voice-based prompt agents.
3. Azure Speech in Foundry Tools
| Feature | Use it to |
|---|---|
| Speech to text (real-time) | Live captions, voice commands |
| Batch or fast transcription | Transcribe recorded calls or meetings |
| Text to speech with neural voices | Read responses aloud naturally |
| SSML (Speech Synthesis Markup Language) | Control pronunciation, pauses, speed, pitch and voice style |
| Speech translation | Translate spoken language in real time |
| Custom speech and custom voice | Improve accuracy for special vocabulary, or create a brand voice (with limited access) |
import os
import azure.cognitiveservices.speech as speechsdk
config = speechsdk.SpeechConfig(
endpoint="https://my-resource.cognitiveservices.azure.com/",
subscription=os.environ["SPEECH_KEY"]) # keep keys out of code
config.speech_synthesis_voice_name = "en-GB-SoniaNeural"
synth = speechsdk.SpeechSynthesizer(speech_config=config)
synth.speak_text_async("Your order has shipped.").get()
Example
A bank's phone line transcribes calls with batch transcription and runs sentiment analysis on the transcripts to flag unhappy customers. It uses a neural voice with SSML to read balances clearly, slowing down for account numbers.
Exam traps to remember
- SSML controls how speech sounds. It doesn't transcribe anything.
- Sentiment analysis returns positive, negative, neutral or mixed with confidence scores.
- Use the Speech service for transcription at scale and fine voice control. Use a multimodal model to understand and answer a spoken question in one step.
Test yourself: 3 check questions and exam-style practice questions on this topic are in the AI-901 Azure AI Fundamentals app.
Practise in the app