Voice-based AI applications are becoming an important part of modern software development. Instead of typing questions into a chatbot, users can speak naturally and receive spoken responses from an AI assistant.
Examples include customer support assistants, appointment booking systems, banking assistants, product information services, and internal enterprise help desks.
Building these applications requires more than connecting a speech-to-text service to a language model. A complete voice agent must capture audio, recognize speech, understand user intent, generate a response, and return audio while maintaining a natural conversation.
Microsoft Foundry provides managed voice agents that combine these capabilities. Developers can configure the agent through Azure AI Projects and use realtime communication to exchange audio, text, and conversation events.
The Azure AI Projects Agents library for .NET provides strongly typed classes for defining voice agents, configuring audio input and output, selecting transcription models, and managing agent versions.
In this article, we will build a voice agent using C#, configure input transcription, understand streaming audio events, connect to a realtime session, and explore the considerations involved in building a production-ready voice application.
1. What Is a Voice Agent?
A voice agent is an AI-powered application that communicates with users through spoken language.
Unlike a traditional chatbot, which mainly accepts text messages, a voice agent accepts audio and can respond using synthesized speech.
Consider a customer asking:
"Can you check the status of my order?"
A voice agent processes the request through several stages:
- Capture the user's microphone audio.
- Convert speech into a representation the agent can understand.
- Interpret the request.
- Retrieve information or execute an appropriate tool.
- Generate a response.
- Convert the response into audio.
- Stream the audio back to the user.
A simplified architecture looks like this:
User Microphone
|
v
Audio Input
|
v
Speech Processing
|
v
AI Agent
|
+------+------+
| |
v v
Business Tools Language Model
| |
+------+------+
|
v
Generated Text
|
v
Text to Speech
|
v
Audio Response
|
v
User Speaker
Microsoft Foundry manages the voice-agent execution environment and provides the communication infrastructure.
Developers configure the agent's model, instructions, audio settings, transcription behavior, and tools rather than building every component independently.
2. What Is Azure AI Projects?
Azure AI Projects is a .NET client library for working with resources in Microsoft Foundry projects.
The newer Agents library provides APIs for managing different agent types, including voice agents.
For voice applications, the relevant package is:
Azure.AI.Projects.Agents
The package provides strongly typed classes for configuring voice-agent definitions.
Some important types include:
Class | Purpose |
|---|
VoiceAgentDefinition | Defines the voice agent |
VoiceAgentAudioConfiguration | Configures audio input and output |
VoiceAgentAudioInputConfiguration | Configures microphone audio processing |
VoiceAgentInputTranscription | Configures speech transcription |
VoiceAgentAudioOutputConfiguration | Configures generated speech |
VoiceAgentServerVadTurnDetection | Detects when a user finishes speaking |
VoiceAgentNoiseReduction | Configures background-noise reduction |
AgentAdministrationClient | Creates and manages agent versions |
The SDK separates agent configuration from the application that connects to the agent.
This is useful because developers can update an agent's behavior without rewriting the client application.
3. Understand Realtime and Cascaded Voice Architectures
Before implementing transcription, it is important to understand the two main voice-processing architectures.
Realtime Speech-to-Speech
A realtime speech-to-speech model processes incoming audio and generates spoken responses directly.
The model can understand audio without requiring the application to implement a separate text-processing pipeline.
User Audio
|
v
Realtime Speech Model
|
v
Generated Audio
|
v
User
This approach is useful when natural conversation, low latency, and interruptions are important.
Cascaded Voice Processing
A cascaded architecture separates speech recognition, language processing, and speech generation.
User Audio
|
v
Speech Recognition
|
v
Recognized Text
|
v
Text-Based AI Agent
|
v
Generated Text
|
v
Speech Synthesis
|
v
Generated Audio
This approach provides more control over transcription and text processing.
For example, an application may need to display recognized words while the user is speaking, apply domain-specific vocabulary, or inspect the transcript before processing a request.
Compare Both Approaches
Feature | Realtime speech-to-speech | Cascaded processing |
|---|
Input | Audio | Audio |
Processing | Direct audio-model processing | Speech recognition followed by text-model processing |
Output | Audio, optionally text | Text and synthesized audio |
Transcription | Additional input transcription can be configured | Transcription is part of the processing pipeline |
Streaming | Realtime audio interaction | Can support streaming transcription and responses |
Best use | Natural spoken conversations | Applications requiring more control over recognized text |
The architecture is derived from the selected model. Developers do not independently switch between realtime and cascaded processing by setting an unrelated configuration flag.
4. Set Up the Development Environment
To build the application, you need:
- An Azure subscription.
- A Microsoft Foundry resource.
- A Foundry project with voice-agent access.
- A supported voice model available to the project.
- .NET 8 SDK or later.
- Visual Studio 2026 or another .NET development environment.
- Azure CLI for local authentication.
You also need the appropriate Foundry project permissions. The Foundry User role or equivalent permissions are required to create and update agents.
Create a Console Application
Run:
dotnet new console --name VoiceAgentDemo --framework net8.0
cd VoiceAgentDemo
Install the required packages:
dotnet add package Azure.AI.Projects.Agents --version 3.0.0
dotnet add package Azure.AI.Extensions.OpenAI --version 3.0.0
dotnet add package Azure.Identity
The Agents package provides voice-agent configuration and management APIs.
Azure.Identity provides Microsoft Entra authentication.
Azure.AI.Extensions.OpenAI supplies the OpenAI-related types used by the voice-agent configuration.
The voice-agent APIs in this SDK version are marked experimental. Review compiler warnings and the package release notes before using them in production.
5. Configure Azure Authentication
The application needs to authenticate with Microsoft Foundry before creating an agent.
For local development, DefaultAzureCredential provides a convenient authentication mechanism.
First, sign in to Azure:
az login
Set the project endpoint:
$env:FOUNDRY_PROJECT_ENDPOINT = "https://your-resource.services.ai.azure.com/api/projects/your-project"
Set the agent name:
$env:FOUNDRY_VOICE_AGENT_NAME = "CustomerSupportVoiceAgent"
The endpoint must point to your actual Foundry project.
DefaultAzureCredential can use the Azure CLI identity during local development.
For production deployments, use a managed identity with the required Foundry permissions rather than storing credentials in application code.
6. Define a Voice Agent Using C#
Now let's create a basic voice agent.
The VoiceAgentDefinition class represents the agent configuration.
It contains information such as:
- Model type.
- Model name.
- Instructions.
- Audio input.
- Audio output.
- Tools.
- Greeting configuration.
Add the following code to Program.cs:
#pragma warning disable AAIP001, OPENAI002
using Azure.AI.Projects.Agents;
VoiceAgentDefinition definition = new()
{
ModelType = VoiceModelType.Managed,
Model = "gpt-realtime-2.1",
Instructions =
"You are a helpful customer support assistant. " +
"Keep spoken answers short, clear, and natural."
};
The AAIP001 warning is associated with experimental voice-agent APIs.
OPENAI002 applies to certain experimental OpenAI audio types used in subsequent configuration examples.
Understand the Model Configuration
ModelType specifies how the model is hosted.
The Managed option selects a service-managed model.
The Model property identifies the model to use.
In this example:
Model = "gpt-realtime-2.1"
selects a service-managed realtime model.
The selected model must be available to the Foundry project and supported in its region.
Write Instructions for Spoken Conversations
Voice-agent instructions should be different from instructions written for a text chatbot.
A spoken response should be easy to understand when heard rather than read.
For example, avoid:
Return a detailed response using five numbered sections,
including a technical explanation and implementation table.
Prefer:
Explain the answer using short sentences.
Speak naturally.
Ask one question at a time.
Avoid unnecessary technical details.
The agent should produce conversational responses rather than long written explanations.
7. Configure Microphone Audio Input
The Audio.Input configuration controls how the agent receives and processes audio.
The following example configures PCM audio and server-side voice activity detection.
using OpenAI.Realtime;
VoiceAgentAudioInputConfiguration inputAudio = new()
{
Format = new RealtimePcmAudioFormat(),
TurnDetection = new VoiceAgentServerVadTurnDetection
{
Threshold = 0.5,
PrefixPadding = TimeSpan.FromMilliseconds(300),
SilenceDuration = TimeSpan.FromMilliseconds(500)
}
};
VoiceAgentAudioConfiguration audioConfig = new()
{
Input = inputAudio
};
definition.Audio = audioConfig;
What Is PCM Audio?
PCM stands for Pulse-Code Modulation.
It represents audio as a sequence of digital samples.
The default RealtimePcmAudioFormat configuration uses 24 kHz PCM audio.
The client must send audio in the format configured for the agent.
If the microphone produces a different sample rate or channel format, the application must convert the audio before sending it.
Sending an incompatible audio format can cause processing errors or unexpected audio quality.
What Is Voice Activity Detection?
Voice Activity Detection, commonly called VAD, identifies when a person starts and stops speaking.
Without turn detection, the application would need to determine manually when the user has finished speaking.
Server-side VAD can handle this automatically.
The example configures:
- Threshold: Controls detection sensitivity.
- PrefixPadding: Preserves audio immediately before detected speech.
- SilenceDuration: Defines the silence required to consider a turn complete.
For example, if a user pauses briefly while speaking, a very short silence threshold may cause the system to end the turn too early.
Adjust these values using recordings that represent your actual users and environment.
8. Configure Input Transcription
A voice agent can process audio while also generating a readable transcript of the user's speech.
This is useful when an application needs to display captions, maintain a conversation record, or provide text to another business component.
Azure AI Projects provides the VoiceAgentInputTranscription class.
Add the following configuration:
inputAudio.Transcription =
new VoiceAgentInputTranscription(
VoiceAgentInputTranscriptionModel.AzureSpeech)
{
PhraseList =
{
"Order Management",
"Customer Support",
"Product Reference",
"SKU 4471"
}
};
The transcription model identifies the speech-recognition service.
The phrase list provides vocabulary hints that may improve recognition of business-specific terms.
For example, a general speech recognizer may incorrectly interpret an internal product name or SKU.
Adding known terminology can help recognition in supported configurations.
Choose the Correct Transcription Model
Azure AI Projects supports several input-transcription model identifiers.
Model | Purpose |
|---|
azure-speech | Azure Speech transcription |
whisper-1 | Whisper-based transcription |
gpt-4o-transcribe | GPT-4o transcription |
gpt-4o-mini-transcribe | GPT-4o Mini transcription |
gpt-transcribe | GPT transcription |
gpt-live-transcribe | Live transcription model |
mai-transcribe | MAI transcription |
azure-speech-streaming | Streaming Azure Speech transcription for cascaded text-model conversations |
The available options depend on the selected voice architecture and service capabilities.
One important distinction is that azure-speech-streaming is supported for cascaded text-model conversations only. It is not supported for realtime speech-to-speech models.
It also requires a nonempty language value, such as en-US.
Do not configure azure-speech-streaming on a realtime speech-to-speech model and expect it to work as a general-purpose streaming transcription option.
For a realtime speech-to-speech agent, select a compatible transcription model such as Azure Speech or another supported model.
9. Understand Streaming Transcription
Streaming transcription means that recognized text can become available while audio is being processed rather than waiting until an entire recording is complete.
For example, imagine a user says:
"I want to check my order status."
A streaming transcription interface may display the recognized text progressively:
I want
I want to check
I want to check my order
I want to check my order status.
This is useful for applications that display live captions.
However, there is an important distinction between the agent's realtime audio conversation and its transcription output.
Realtime audio transport does not automatically mean that every transcription model returns partial text.
For the Foundry voice-agent configuration:
- Azure Speech transcription can provide transcription results for incoming audio.
- The exact timing and event behavior depend on the selected model and architecture.
- azure-speech-streaming supports streaming transcription in cascaded text-model conversations.
- It is not supported for realtime speech-to-speech models.
For standalone Voice Live transcription sessions, Microsoft also documents mai-transcribe-2-streaming as a preview option that produces partial transcript events while audio is being sent.
That standalone transcription workflow is different from configuring transcription inside a managed voice agent.
This distinction matters when selecting the architecture for live captions or speech-driven business applications.
10. Configure the Agent's Voice Output
A voice agent should return spoken responses that match the application experience.
The Audio.Output configuration determines the voice implementation and its properties.
For example:
VoiceAgentAudioOutputConfiguration outputAudio = new()
{
Voice = "en-US-AvaNeural",
VoiceType = VoiceType.AzureStandard,
Speed = 1.0f
};
audioConfig.Output = outputAudio;
The example uses an Azure standard neural voice.
The Voice property identifies the selected voice.
The Speed property controls speaking speed. The supported range is 0.25 to 1.5, with 1.0 representing the default speed.
Other voice options include:
- OpenAI voice.
- Azure standard voice.
- Azure custom voice.
- Azure personal voice.
- Avatar voice synchronization.
The available settings depend on the selected voice type.
Return Both Audio and Text
Some applications need spoken responses and readable text.
For example, a customer support application may play the agent's response while displaying the same words on the screen.
Configure the output modalities:
definition.OutputModalities.Add(
VoiceOutputModality.Audio);
definition.OutputModalities.Add(
VoiceOutputModality.Text);
This allows the client to work with both response formats.
The client can use text output for captions, accessibility, or conversation display while audio output is used for playback.
11. Create a Version of the Voice Agent
After configuring the model, instructions, audio input, transcription, and output, create an agent version.
The agent administration client provides the management operations.
Add the following code:
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using Azure.Identity;
string projectEndpoint =
Environment.GetEnvironmentVariable(
"FOUNDRY_PROJECT_ENDPOINT")
?? throw new InvalidOperationException(
"Set FOUNDRY_PROJECT_ENDPOINT.");
string agentName =
Environment.GetEnvironmentVariable(
"FOUNDRY_VOICE_AGENT_NAME")
?? throw new InvalidOperationException(
"Set FOUNDRY_VOICE_AGENT_NAME.");
AgentAdministrationClient agentsClient = new(
new Uri(projectEndpoint),
new DefaultAzureCredential());
BinaryData request = ModelReaderWriter.Write(
new ProjectsAgentVersionCreationOptions(definition));
using BinaryContent content = BinaryContent.Create(request);
ClientResult result =
await agentsClient.CreateAgentVersionAsync(
agentName,
content);
ProjectsAgentVersion created =
ModelReaderWriter.Read<ProjectsAgentVersion>(
result.GetRawResponse().Content)
?? throw new InvalidOperationException(
"The agent response is empty.");
Console.WriteLine(
$"Created voice agent: {agentName}");
Console.WriteLine(
$"Agent version: {created.Version}");
Why Does the SDK Use Agent Versions?
Every create or update operation produces a new immutable agent version.
An immutable version means that its configuration is not modified in place.
For example:
CustomerSupportVoiceAgent
|
+-- Version 1
|
+-- Version 2
|
+-- Version 3
This allows developers to update the agent configuration while retaining previous versions.
You can test a new version before making it active.
Versioning is useful when changing instructions, models, transcription settings, or voice configurations.
12. Connect to the Realtime Voice Agent
Creating an agent version makes its voice endpoint available.
The documented voice protocol endpoint follows this pattern:
wss://{project-endpoint}/agents/{agent-name}/endpoint/protocols/voice?api-version=v1
The connection uses a WebSocket.
A WebSocket is a persistent, two-way communication connection between a client and a server.
Unlike a typical HTTP request, where the client sends a request and receives a response, a WebSocket allows both sides to exchange messages continuously.
This is useful for voice applications because audio input and generated audio output can be exchanged throughout a conversation.
Realtime Client in .NET
The Azure AI Projects SDK includes a ProjectsRealtimeClient and ProjectsRealtimeSessionClient integration for realtime voice-agent communication.
The official .NET sample uses the OpenAI Realtime command and event model while connecting to the Foundry voice-agent endpoint.
A simplified text-exchange example looks like this:
using Azure.AI.Projects;
using Azure.AI.Projects.Agents;
using Azure.Identity;
using OpenAI.Realtime;
AIProjectClient projectClient = new(
endpoint: new Uri(projectEndpoint),
tokenProvider: new DefaultAzureCredential());
using ProjectsRealtimeSessionClient session =
(ProjectsRealtimeSessionClient)
await projectClient.ProjectsRealtimeClient.StartSessionAsync(
agentName,
intent: null);
await session.AddItemAsync(
RealtimeItem.CreateUserMessageItem(
"Please help me check an order."));
await session.StartResponseAsync();
await foreach (
RealtimeServerUpdate update in session.ReceiveUpdatesAsync())
{
Console.WriteLine($"Event: {update.Kind}");
if (update is RealtimeServerUpdateResponseOutputTextDone textDone)
{
Console.WriteLine(
$"Agent response: {textDone.Text}");
}
if (update is RealtimeServerUpdateResponseDone)
{
break;
}
}
This example demonstrates a text exchange with a voice agent using the realtime session client.
It does not capture microphone audio or play generated audio.
For a complete audio implementation, the client must send audio frames using the realtime audio APIs and handle the incoming audio events.
The realtime client reuses the OpenAI Realtime command and event model while connecting to the Foundry agent endpoint.
The client SDK and experimental API versions should be aligned with the official .NET voice-agent sample. Do not mix an older AIProjectClient package version with the newer Agents package without checking API compatibility.
13. Understand Realtime Audio Events
A realtime voice application receives different events throughout a conversation.
These events describe session changes, user input, agent responses, and audio output.
Some important event categories include:
Event category | Purpose |
|---|
Session events | Indicate that the session was created or updated |
Input audio events | Represent incoming audio processing |
Transcription events | Provide recognized user speech |
Response events | Indicate response creation and completion |
Output audio events | Carry generated audio data |
Error events | Report processing or communication failures |
The application should process these events rather than assuming that every WebSocket message contains user-facing text.
For example, the client may receive multiple audio chunks for one response.
It should queue those chunks and play them in the correct order.
Similarly, transcript events should be associated with the correct conversation turn.
Example Event Flow
Start Session
|
v
Session Updated
|
v
Send Audio
|
v
Input Audio Processing
|
v
Transcription Result
|
v
Agent Generates Reply
|
v
Output Audio Streaming
|
v
Response Completed
A production client should also handle interrupted responses, connection failures, and session termination.
14. Configure Turn Detection and Interruptions
A natural voice conversation should allow users to interrupt the agent.
For example, a customer may ask a question, receive the first part of an answer, and then interrupt with another question.
The voice agent supports turn-detection configuration and response interruption behavior.
For more advanced scenarios, semantic end-of-utterance detection can help determine when a user has finished speaking based on meaning rather than silence alone.
Important configuration options include:
Property | Purpose |
|---|
SilenceDuration | Silence required before ending a turn |
PrefixPadding | Audio retained before speech detection |
IdleTimeout | Maximum idle period |
CreateResponseEnabled | Automatically creates a response after a completed turn |
InterruptResponseEnabled | Allows user speech to interrupt an agent response |
RemoveFillerWords | Removes filler words from transcription |
These settings should be adjusted according to the application.
For a customer support phone call, longer pauses may be common.
For a hands-free assistant, faster turn detection may provide a more responsive experience.
Test interruption behavior with real microphone audio rather than relying only on configuration values.
15. Improve Transcription Accuracy With Phrase Lists and Custom Speech
General-purpose speech recognition may not recognize business-specific terminology correctly.
Consider an application that handles product orders.
Users may mention:
- Product names.
- Customer IDs.
- SKU numbers.
- Technical terms.
- Internal service names.
A transcription engine may interpret unfamiliar terms incorrectly.
Phrase lists provide hints that help recognition systems handle domain-specific vocabulary.
For example:
inputAudio.Transcription =
new VoiceAgentInputTranscription(
VoiceAgentInputTranscriptionModel.AzureSpeech)
{
PhraseList =
{
"Azure Kubernetes Service",
"Order Management",
"Contoso Aurora",
"SKU 4471"
}
};
For more specialized requirements, Foundry also supports Custom Speech deployments for supported transcription configurations.
A Custom Speech deployment can help adapt speech recognition to a particular domain, vocabulary, or speaking style.
Phrase lists and Custom Speech are not interchangeable.
A phrase list provides vocabulary hints, while Custom Speech uses a customized speech-recognition model.
Test both options using actual user recordings before selecting a production configuration.
16. Add Noise Reduction and Echo Cancellation
Voice applications often run in environments where background noise affects recognition quality.
Examples include:
- Office environments.
- Call centers.
- Public spaces.
- Mobile devices.
- Headset-based communication.
Azure voice-agent configuration supports noise-reduction options.
Some available modes include:
Noise reduction type | Typical scenario |
|---|
AzureDeepNoiseSuppression | General background-noise reduction |
AzureDeepNoiseSuppressionHeadset | Background speech and headset scenarios |
AzurePersonalNoiseSuppression | Focusing on one caller when other people are nearby |
Echo cancellation is also important.
When the agent speaks through a device speaker, its generated audio may be captured again by the microphone.
This can cause the agent to interpret its own response as new user input.
Echo cancellation helps reduce this problem.
The appropriate configuration depends on the microphone and audio-routing architecture used by the client.
17. Store Conversations and Manage Privacy
Voice conversations can contain sensitive information.
For example, a customer may provide:
- Name.
- Email address.
- Phone number.
- Order details.
- Account information.
- Other personal information.
The Foundry voice-agent configuration provides a Store property.
By default, Store is false.
When Store is enabled, the service can persist the conversation, including its transcript, event timeline, and raw audio.
There is no separate audio-logging switch for this behavior; raw audio persistence is associated with conversation storage.
Example:
definition.Store = true;
Enable conversation persistence only when the application has a clear requirement.
Before storing voice conversations, define:
- Data retention policies.
- Access controls.
- Encryption requirements.
- User consent.
- Privacy notices.
- Data deletion procedures.
- Applicable regulatory requirements.
Do not enable audio persistence simply because it is available.
For many applications, storing only the information required for business operations is a better approach.
18. Monitor Voice Agent Performance
A voice agent should be monitored like any other production application.
Traditional API monitoring does not provide enough information about a voice conversation.
Developers should monitor:
- Connection failures.
- Session creation time.
- Time to first response.
- Audio processing errors.
- Transcription failures.
- Response interruptions.
- Tool execution time.
- Token usage.
- Conversation completion.
Azure AI Projects provides tracing integration through OpenTelemetry.
The newer SDK includes voice-agent tracing for realtime connection and session operations.
It can capture information such as session identifiers, response identifiers, audio byte counts, and time to first nonempty text or audio output.
Content recording is disabled by default.
If you enable message-content recording, traces may contain transcripts, tool parameters, and other sensitive information.
For example, the following switch enables GenAI message-content recording:
AppContext.SetSwitch(
"Azure.Experimental.TraceGenAIMessageContent",
true);
Use this only when the additional diagnostic information is necessary and the application has appropriate privacy controls.
19. Common Problems and Troubleshooting
Authentication Failed
Check whether the local user is signed in through Azure CLI.
az login
Verify the project endpoint and role assignments.
For production deployments, confirm that the managed identity has the required Foundry permissions.
Agent Creation Failed
Verify that:
- The project endpoint is correct.
- The selected model is available.
- The agent name is valid.
- The identity has agent-management permissions.
- The SDK package versions are compatible.
No Transcription Events
Check whether input transcription is enabled.
Verify that the selected transcription model supports the configured architecture.
For realtime speech-to-speech agents, do not use azure-speech-streaming.
Poor Recognition Accuracy
Check the input audio format and sample rate.
Use an appropriate language setting when supported.
Add phrase hints for domain-specific vocabulary and test with representative audio.
Agent Responds Too Slowly
Investigate:
- Audio capture delay.
- Network latency.
- Turn-detection settings.
- Model response time.
- Tool execution time.
- Audio playback buffering.
Do not assume that the model is the only source of latency.
Audio Is Repeated or Interrupted
Check microphone and speaker routing.
Configure echo cancellation where appropriate.
Also verify that the client correctly handles interruption and cancellation events.
20. Best Practices for Production Voice Agents
Use Short Spoken Responses
Voice responses should be easy to follow.
Avoid returning long paragraphs unless the user specifically requests a detailed explanation.
Choose the Correct Architecture
Use realtime speech-to-speech for natural spoken interactions.
Use cascaded processing when streaming transcription and explicit text-processing control are important.
Configure the Correct Audio Format
Make sure the client audio format matches the agent configuration.
Do not send 16 kHz audio when the session expects 24 kHz PCM without converting it first.
Test With Real Speech
Test different accents, speaking speeds, background noise, and microphone types.
A configuration that works with clean test audio may behave differently in a real call center or mobile environment.
Handle Interruptions
Allow users to interrupt long responses when the experience requires natural conversation.
Protect Conversation Data
Store transcripts and raw audio only when required.
Apply access controls and retention policies.
Keep Tool Execution Secure
If the voice agent can call business tools, validate every tool request on the application side.
Never treat a model-generated tool request as an authorization decision.
Monitor End-to-End Latency
Measure the time from microphone input to the first useful agent response.
This gives a more realistic understanding of user experience than measuring model response time alone.
21. Advantages and Limitations
Advantages
- Managed voice infrastructure: Microsoft Foundry handles important voice-agent execution capabilities.
- .NET integration: Developers can define and manage voice agents using C#.
- Realtime communication: Persistent sessions support interactive audio conversations.
- Configurable transcription: Developers can select supported speech-recognition models and configure domain vocabulary.
- Multiple voice options: Applications can configure different voice implementations.
- Version management: Immutable agent versions make configuration updates easier to test and manage.
- Monitoring integration: OpenTelemetry tracing provides visibility into realtime sessions and response processing.
Limitations
- Model compatibility: Transcription options depend on the selected model and architecture.
- Experimental SDK APIs: Some .NET voice-agent types and realtime features are marked experimental.
- Audio complexity: Developers must handle audio formats, buffering, playback, and connection lifecycle.
- Network dependency: Realtime voice applications require a stable network connection.
- Privacy requirements: Transcripts and audio recordings may contain sensitive information.
- Regional availability: Model and voice availability depends on the Foundry resource region.
- Cost considerations: Model usage, speech processing, audio generation, and supporting services can contribute to operating costs.
Conclusion
Microsoft Foundry makes it possible to build managed voice agents that support realtime audio conversations, speech recognition, and spoken responses.
The Azure AI Projects Agents library provides strongly typed .NET classes for defining voice agents and configuring their input and output audio.
Developers can select supported transcription models, configure phrase lists, manage turn detection, and create immutable agent versions.
One important implementation detail is the difference between realtime speech-to-speech and cascaded voice architectures. The azure-speech-streaming transcription option is supported for cascaded text-model conversations, not realtime speech-to-speech models.
For production applications, combine the correct voice architecture with secure authentication, audio-format validation, interruption handling, privacy controls, and OpenTelemetry monitoring.
This approach provides a practical foundation for building customer support assistants, enterprise voice interfaces, and other conversational applications using C# and Microsoft Foundry.
Join the conversation! Your thoughts help the community grow.