Text analysis solutions ยท 10โ€“15%

Speech solutions

~3 min read

Speech to text (STT) transcribes spoken audio into text. Text to speech (TTS) synthesizes spoken audio from text. Azure gives you two ways to do both.

Two routes to speech โ€” pick correctly

RouteModels/objectsWhen
GenAI audio models (OpenAI SDK)gpt-4o-transcribe, -mini-transcribe, -transcribe-diarize (STT); gpt-4o-tts, -mini-tts (TTS)Simple transcribe/synthesize in a gen-AI app
Azure Speech (Foundry Tools, Speech SDK)SpeechRecognizer, SpeechSynthesizer, TranslationRecognizerFull control: voices, SSML, translation, real-time

How the GenAI route works

You call the model like any other OpenAI API. Two calls to know:

Azure Speech SDK pattern (memorize)

Every Speech SDK app follows the same five steps:

  1. Create a SpeechConfig with your key and endpoint (or region). It holds the connection details.
  2. Optionally create an AudioConfig to say where audio comes from or goes to. Default is microphone in, speaker out; you can point it at a file instead.
  3. Build the worker object from those two configs: a SpeechRecognizer (audio in, text out) or a SpeechSynthesizer (text in, audio out).
  4. Call its method โ€” recognize_once_async() to transcribe, speak_text_async() to speak.
  5. Check result.reason to confirm it worked.
OpObjectMethodSuccess reason
STTSpeechRecognizerrecognize_once_async()RecognizedSpeech (else NoMatch, Canceled)
TTSSpeechSynthesizerspeak_text_async() / speak_ssml_async()SynthesizingAudioCompleted

SSML

SSML (Speech Synthesis Markup Language) is an XML-based markup language that controls how synthesized speech sounds. Instead of plain text, you send markup that sets:

Speech translation

Speech translation converts spoken input in one language into text (or speech) in other languages, in one call.

Voice Live API

The Voice Live API is an Azure Speech API for building agents that hold real-time voice conversations. It replaces the manual chain of speech-to-text, then a language model, then text-to-speech with one low-latency, bidirectional connection.

If the question says “real-time conversational voice agent, interruptions, low latency”, the answer is Voice Live. “Transcribe a recorded file” means an STT model or SpeechRecognizer. “Speak with an excited style” means SSML.