Speech and spoken prompts

Recognition and synthesis, SSML, and the exam-relevant choice between a cascaded pipeline and a native multimodal audio model.

  • Text & speech
  • 17 minutes

After this lesson you can

  • Tell recognition from synthesis and real-time from batch
  • Say what SSML controls
  • Justify a native multimodal audio model over a three-service cascade

Which way is the audio flowing?

CapabilityDirectionAlso known as
Speech recognitionAudio → textSpeech to text, STT, ASR
Speech synthesisText → audioText to speech, TTS
Speech translationAudio in one language → text or audio in another-
Recognition modeUse it for
Real-timeLive captions, voice assistants, streaming audio as it happens
BatchLarge volumes of pre-recorded files in storage, processed asynchronously

Check your understanding

AI workloads

A contact centre must transcribe 200,000 archived call recordings stored in Azure Blob Storage. Results are needed within a day; nothing is live.

Which speech-to-text mode is appropriate?

SSML: controlling how it sounds

Speech Synthesis Markup Language is an XML format for fine-grained control over synthesized speech. It applies to synthesis only - it has nothing to do with recognition.

The tags worth recognising
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US">
  <voice name="en-US-AvaNeural">
    <prosody rate="-10%" pitch="+5Hz">Welcome to Microsoft Foundry.</prosody>
    <break time="500ms"/>
    <emphasis level="strong">How can I help today?</emphasis>
  </voice>
</speak>
  • <voice> - which neural voice and language
  • <prosody> - speaking rate, pitch, volume
  • <break> - pauses, to the millisecond
  • <emphasis> - stress on a phrase
  • <phoneme> - force a specific pronunciation

Check your understanding

Text & speech

Which two can SSML control? (Choose two.)

Choose 2. Each correct answer is part of the solution. Each correct selection is worth one point.

Choose 2, then check.

Voices

Both kinds of custom voice are Limited Access: you apply with an eligible use case first.
OptionWhat it isChoose it when
Standard voicesHundreds of natural voices, including HD voices, across more than 150 localesAlmost always - this is the default
Professional voice (custom voice)A branded voice fine-tuned from studio recordings of a voice talent, with their recorded consentYou need a distinctive brand or character voice
Personal voice (custom voice)A replica of a user's own voice from a short sampleUsers voice their own content, such as personalised narration

Check your understanding

Text & speech

A global brand wants its assistant to speak with a unique, recognisable voice that is not available in the standard catalogue. What do they need?

Cascade vs. native multimodal audio

"Respond to spoken prompts by using a deployed multimodal model" is a named exam objective, so understand why you would choose it.

Cascade: STT → model → TTSNative multimodal audio model
LatencySum of three servicesSingle hop - fast enough for natural turn-taking
Tone, emphasis, emotionLost at the transcription stepPreserved - the model hears the audio
Control over each stageFull - swap the voice, tune the transcriptLess granular
Branded custom voiceYes, via TTSConstrained to the model's voices

Know this: How to answer these

Latency, naturalness, or picking up on how something was said ⇒ native multimodal. Needing a specific branded voice, or control over the transcript itself ⇒ cascade with Azure Speech.

Changed: Foundry now packages both for you

Voice Live is a fully managed speech-to-speech API with noise suppression, echo cancellation and turn detection built in. A voice-based prompt agent runs on it and lets you pick either architecture - a native realtime speech model such as the gpt-realtime family, or a cascade of speech recognition, a text model and speech synthesis - with no voice orchestration code of your own.

Check your understanding

Text & speech Hard

A hands-free assistant for drivers must accept a spoken question and answer out loud, as quickly and naturally as possible, picking up on urgency in the speaker's voice.

Which architecture best meets this?

Check your understanding

AI workloads Hard

What advantage does a natively multimodal model that accepts audio directly have over a cascaded speech-to-text → language model → text-to-speech pipeline?

A lightweight speech client

Both directions need the same three ingredients: credentials and region, an audio source or destination, and a recognizer or synthesizer.

Speech to text, then text to speech
import os
import azure.cognitiveservices.speech as speechsdk

config = speechsdk.SpeechConfig(
    subscription=os.environ["SPEECH_KEY"],
    region=os.environ["SPEECH_REGION"],
)

# --- Recognition: audio in, text out ---
audio_in = speechsdk.audio.AudioConfig(filename="call.wav")
recognizer = speechsdk.SpeechRecognizer(speech_config=config, audio_config=audio_in)
result = recognizer.recognize_once_async().get()
if result.reason == speechsdk.ResultReason.RecognizedSpeech:
    print("Heard:", result.text)

# --- Synthesis: text in, audio out ---
config.speech_synthesis_voice_name = "en-US-AvaNeural"
audio_out = speechsdk.audio.AudioOutputConfig(filename="reply.wav")
synthesizer = speechsdk.SpeechSynthesizer(speech_config=config, audio_config=audio_out)
synthesizer.speak_text_async("Your deployment is ready.").get()

Check your understanding

Text & speech

A Python app must transcribe a WAV file. Which pieces of configuration are required at minimum?

Vocabulary that shows up

  • Phoneme - the smallest unit of sound that distinguishes words. "Cat" = /k/ /æ/ /t/.
  • Grapheme - a written character. Synthesis converts graphemes to phonemes.
  • Sampling / sample rate - digitising a continuous waveform; 16 kHz is a common speech standard.
  • Spectrogram - audio frequencies plotted over time, often the input to acoustic models.
  • Speaker diarization - labelling who spoke when.

Check your understanding

Text & speech

What is a phoneme?