Answer Spoken Prompts with a Multimodal Model
30-second answer
To respond to a spoken prompt, deploy an audio-capable multimodal model (such as the gpt-audio or gpt-4o-audio-preview family) in Foundry and send the recording as an input_audio content part (base64 audio plus its format). The model understands the speech directly and can reply in text or audio. The older route is a pipeline: speech to text, then a text model, then text to speech. For live, low-latency talk you use a realtime model or the Voice Live API.
Simulate it » No Azure account neededExam objective: 2.2.2 Respond to spoken prompts by using a deployed multimodal model. (Skills measured as of April 15, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
Deploy an <strong>audio-capable</strong> model. Not every chat model accepts audio.
👆 Click the glowing item in the portal to continue
Read the steps as text
- Deploy an audio-capable model. Not every chat model accepts audio.
- Attach the spoken question directly. No separate transcription step.
- In code, the audio goes in as an input_audio content part (base64 WAV).
- Know both patterns and when each fits.
🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.
🖱️ Drag to rotate · scroll or pinch to zoom
Speech to text
Speech recognition turns spoken audio into text: live captions, call transcripts, voice commands. It can also translate speech into another language as you talk.
🤔 What happens if…
Read this tour as text
- Five workload lanes. Most AI apps fall into a few workloads: generative and agentic AI, text analysis, speech, computer vision and information extraction. Each lane here takes a different kind of input and turns it into something useful.
- Text analysis. A hotel review goes in. Azure Language returns the sentiment (positive, neutral, negative), key phrases, named entities (people, places, dates), PII and a short summary.
- Speech to text. Speech recognition turns spoken audio into text: live captions, call transcripts, voice commands. It can also translate speech into another language as you talk.
- Text to speech. Speech synthesis turns text into natural speech with a neural voice. SSML lets you control speed, pitch and pauses. Think audiobooks, voice assistants and accessibility readers.
- Computer vision. A photo goes in. Vision models return a caption, tags, objects with boxes, and any printed or handwritten text (OCR). A multimodal chat model can also answer questions about the picture.
- Image generation. Image-generation models work the other way round: a text prompt goes in and a brand-new image comes out. Guardrails block harmful requests, and generated images are marked with content credentials.
- Extract from documents. Azure Content Understanding reads an invoice and returns fields you defined (vendor, date, total) with a confidence score for each, so low-confidence values can go to a person.
- Extract from audio and video. The same service handles media: an audio call becomes a transcript with speakers and a summary; a video is split into segments with key frames, descriptions and chapters.
Transcribe a spoken question, answer it with a neural voice, then send the same audio straight to an audio-capable model.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
Customers want to ask questions by voice, not by typing.
😊 THE SOLUTION
Send their audio straight to an audio-capable model.
- Typing on phones is slow✓ Ask by voice
- Three services to wire up✓ One multimodal call
- Tone gets lost✓ The model hears it
Start with a question
What if your customers would rather talk than type?
A farmer in Madurai wants to know whether to spray before tomorrow’s rain. Typing a long question in English on a small phone is slow. Saying it out loud takes five seconds.
Some models can now listen. You send them the recording, and they understand it the same way they understand typed text. That’s a spoken prompt to a multimodal model.
Explain it like I’m 10
The technical explanation
A multimodal model takes more than one kind of input. Audio-capable models in the Foundry model catalog (for example the gpt-audio and gpt-4o-audio-preview families) take speech as input and can return text, audio or both. Check the model card for supported audio formats, languages and regions, and deploy it in your project like any other model.
In the Foundry chat playground you can try this first: pick the audio model deployment, record or attach a short clip, and read the reply.
Audio-capable model
- Send the recording as input_audio
- One model call
- Reply in text or audio
- Good for voice questions in an app
Speech pipeline
- Speech to text → text model → text to speech
- Three calls your code chains
- Custom speech, SSML, any neural voice
- Transcript visible at each step
Realtime / Voice Live
- Streams audio both ways
- Lowest latency, can be interrupted
- Phone bots, live assistants
- Uses a realtime model or Voice Live API
Sending audio from Python
Audio-capable models use the Chat Completions message format. The user message holds a list of content parts: a text instruction and an input_audio part with the recording as base64.
import base64, os
from openai import OpenAI
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
# Sign in with Microsoft Entra ID (az login locally)
token = get_bearer_token_provider(DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default")
client = OpenAI(
base_url=os.environ["AZURE_OPENAI_ENDPOINT"] + "openai/v1/", # https://<resource>.openai.azure.com/
api_key=token,
)
# Read a short WAV recording and encode it as base64
with open("question.wav", "rb") as f:
audio_b64 = base64.b64encode(f.read()).decode("utf-8")
completion = client.chat.completions.create(
model="gpt-audio", # your audio-capable deployment name
modalities=["text"], # use ["text", "audio"] to get speech back too
messages=[
{"role": "system", "content": "You are a farm advisor. Answer in two short sentences."},
{"role": "user", "content": [
{"type": "text", "text": "Answer the question in this recording."},
{"type": "input_audio", "input_audio": {"data": audio_b64, "format": "wav"}},
]},
],
)
print(completion.choices[0].message.content)
If you ask for ["text", "audio"] you also pass an audio option (voice and output format), and the reply’s message.audio holds base64 audio you can save and play, plus a transcript of what it said.
Architect level Guardrails and privacy still apply
The audio is a prompt like any other, so your deployment’s guardrails (content filters) apply to what the model hears and says. Recordings can carry personal data such as names and account numbers, so treat stored audio like any other personal data: keep only what you need, and tell users their voice is being processed by AI. That’s the transparency principle in practice.
Real-world business scenario
An agritech co-operative in Tamil Nadu
- The problem
- Members asked crop questions by phone in mixed Tamil and English. A typed chatbot went unused because many members preferred to speak.
- What they used
- A small app that records the question, sends it as input_audio to an audio-capable model deployment in Foundry with a farm-advisor system message, and plays back the text reply through text to speech.
- Why that choice
- One model call understood mixed-language speech without a separate transcription step, and the system message kept answers short and on topic.
- The result
- Voice questions became the most used channel within weeks, and agronomists only handled the questions the model flagged as unsure.
When to use it and when not to
✓ Use it when…
- Users prefer to ask by voice, for example on a phone or in the field.
- You want the simplest path from a recording to an answer, with one model call.
- The model should pick up tone or hesitation that a plain transcript loses.
✕ Think twice when…
- You need a particular branded neural voice, SSML control or custom vocabulary. Use Azure Speech.
- You need live, interruptible conversation. Use a realtime model or the Voice Live API.
- Regulations require a stored transcript at each step. The pipeline makes that easier.
↔ Alternatives to consider
- Azure Speech speech to text plus a text model plus text to speech.
- Voice Live API for live voice agents.
Test yourself with exercises
4 original practice questions in the AI-901 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.
Interview preparation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner How can an app answer a question the user speaks out loud?
Model answer
Either send the recording straight to an audio-capable multimodal model, which understands the speech and replies, or transcribe it with speech to text first and send the text to a normal chat model. The first is fewer moving parts; the second gives me a transcript at every step.
Interviewer follows up
Can the model answer with a voice?
You
Yes. Audio-capable models can return audio as well as text, if you ask for both in the request.
Intermediate What does the request look like when you send audio to the model?
Model answer
The user message has a list of content parts. One is a text part with the instruction, and one is an input_audio part with the base64-encoded recording and its format, such as wav. I also set modalities if I want spoken audio back.
Experienced developer When would you still choose the speech-to-text pipeline?
Model answer
When I need features the Speech service gives me, like custom speech for domain words, diarization, a particular neural voice or SSML control, or when I want to log and filter the transcript before it reaches the model. The pipeline costs more latency, but each step is easy to inspect.
Scenario A bank wants a phone assistant that can be interrupted mid-sentence. What do you suggest?
Model answer
A realtime approach, such as a gpt-realtime deployment or the Voice Live API. Sending one recording at a time feels like walkie-talkie; realtime streams audio both ways, so the caller can interrupt naturally.
Quick revision
Key points
- Audio-capable multimodal models accept speech directly and can reply in text or audio.
- Audio goes in an input_audio content part as base64 data with a format such as wav.
- The classic alternative is speech to text, then a text model, then text to speech.
- For live, interruptible conversations use a realtime model or the Voice Live API.
- You can test spoken prompts in the Foundry chat playground before writing code.
Important terminology
- Multimodal model
- A model that accepts more than one kind of input, such as text plus audio or text plus images.
- Audio-capable model
- A model deployment, such as the gpt-audio family, that takes audio input and can return text or spoken audio.
- input_audio
- The chat message content part that carries base64-encoded audio and its format, such as wav.
- Speech pipeline
- Speech to text, then a text model, then text to speech, chained by your code.
- Voice Live API
- An Azure Speech API for low-latency, two-way voice conversations with a generative model.
Common mistakes
- Sending the audio file path instead of base64-encoded audio data.
- Expecting a text-only model such as gpt-4.1-mini to accept audio input.
Exam tips
- "Send speech directly to the model" = audio-capable multimodal model with input_audio.
- "Low-latency live voice conversation" = realtime model or Voice Live API.
Five quick revision questions
-
1.Which content part carries audio in the request?Show
input_audio
-
2.How is the audio encoded in the request?Show
As base64 data, with its format (for example wav).
-
3.Name the three steps of the speech pipeline.Show
Speech to text, a text model, text to speech.
-
4.Can an audio-capable model reply with speech?Show
Yes, it can return audio as well as text.
-
5.What do you use for a live, interruptible voice chat?Show
A realtime model or the Voice Live API.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Build an App with Azure Speech in Foundry Tools
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.