{"id":"f0be5ad1-91f7-46e6-9582-5c39fa0cdc46","shortId":"aPU9aB","kind":"skill","title":"azure-ai-voicelive-dotnet","tagline":"Azure AI Voice Live SDK for .NET. Build real-time voice AI applications with bidirectional WebSocket communication.","description":"# Azure.AI.VoiceLive (.NET)\n\nReal-time voice AI SDK for building bidirectional voice assistants with Azure AI.\n\n## Installation\n\n```bash\ndotnet add package Azure.AI.VoiceLive\ndotnet add package Azure.Identity\ndotnet add package NAudio                    # For audio capture/playback\n```\n\n**Current Versions**: Stable v1.0.0, Preview v1.1.0-beta.1\n\n## Environment Variables\n\n```bash\nAZURE_VOICELIVE_ENDPOINT=https://<resource>.services.ai.azure.com/\nAZURE_VOICELIVE_MODEL=gpt-4o-realtime-preview\nAZURE_VOICELIVE_VOICE=en-US-AvaNeural\n# Optional: API key if not using Entra ID\nAZURE_VOICELIVE_API_KEY=<your-api-key>\n```\n\n## Authentication\n\n### Microsoft Entra ID (Recommended)\n\n```csharp\nusing Azure.Identity;\nusing Azure.AI.VoiceLive;\n\nUri endpoint = new Uri(\"https://your-resource.cognitiveservices.azure.com\");\nDefaultAzureCredential credential = new DefaultAzureCredential();\nVoiceLiveClient client = new VoiceLiveClient(endpoint, credential);\n```\n\n**Required Role**: `Cognitive Services User` (assign in Azure Portal → Access control)\n\n### API Key\n\n```csharp\nUri endpoint = new Uri(\"https://your-resource.cognitiveservices.azure.com\");\nAzureKeyCredential credential = new AzureKeyCredential(\"your-api-key\");\nVoiceLiveClient client = new VoiceLiveClient(endpoint, credential);\n```\n\n## Client Hierarchy\n\n```\nVoiceLiveClient\n└── VoiceLiveSession (WebSocket connection)\n    ├── ConfigureSessionAsync()\n    ├── GetUpdatesAsync() → SessionUpdate events\n    ├── AddItemAsync() → UserMessageItem, FunctionCallOutputItem\n    ├── SendAudioAsync()\n    └── StartResponseAsync()\n```\n\n## Core Workflow\n\n### 1. Start Session and Configure\n\n```csharp\nusing Azure.Identity;\nusing Azure.AI.VoiceLive;\n\nvar endpoint = new Uri(Environment.GetEnvironmentVariable(\"AZURE_VOICELIVE_ENDPOINT\"));\nvar client = new VoiceLiveClient(endpoint, new DefaultAzureCredential());\n\nvar model = \"gpt-4o-mini-realtime-preview\";\n\n// Start session\nusing VoiceLiveSession session = await client.StartSessionAsync(model);\n\n// Configure session\nVoiceLiveSessionOptions sessionOptions = new()\n{\n    Model = model,\n    Instructions = \"You are a helpful AI assistant. Respond naturally.\",\n    Voice = new AzureStandardVoice(\"en-US-AvaNeural\"),\n    TurnDetection = new AzureSemanticVadTurnDetection()\n    {\n        Threshold = 0.5f,\n        PrefixPadding = TimeSpan.FromMilliseconds(300),\n        SilenceDuration = TimeSpan.FromMilliseconds(500)\n    },\n    InputAudioFormat = InputAudioFormat.Pcm16,\n    OutputAudioFormat = OutputAudioFormat.Pcm16\n};\n\n// Set modalities (both text and audio for voice assistants)\nsessionOptions.Modalities.Clear();\nsessionOptions.Modalities.Add(InteractionModality.Text);\nsessionOptions.Modalities.Add(InteractionModality.Audio);\n\nawait session.ConfigureSessionAsync(sessionOptions);\n```\n\n### 2. Process Events\n\n```csharp\nawait foreach (SessionUpdate serverEvent in session.GetUpdatesAsync())\n{\n    switch (serverEvent)\n    {\n        case SessionUpdateResponseAudioDelta audioDelta:\n            byte[] audioData = audioDelta.Delta.ToArray();\n            // Play audio via NAudio or other audio library\n            break;\n            \n        case SessionUpdateResponseTextDelta textDelta:\n            Console.Write(textDelta.Delta);\n            break;\n            \n        case SessionUpdateResponseFunctionCallArgumentsDone functionCall:\n            // Handle function call (see Function Calling section)\n            break;\n            \n        case SessionUpdateError error:\n            Console.WriteLine($\"Error: {error.Error.Message}\");\n            break;\n            \n        case SessionUpdateResponseDone:\n            Console.WriteLine(\"\\n--- Response complete ---\");\n            break;\n    }\n}\n```\n\n### 3. Send User Message\n\n```csharp\nawait session.AddItemAsync(new UserMessageItem(\"Hello, can you help me?\"));\nawait session.StartResponseAsync();\n```\n\n### 4. Function Calling\n\n```csharp\n// Define function\nvar weatherFunction = new VoiceLiveFunctionDefinition(\"get_current_weather\")\n{\n    Description = \"Get the current weather for a given location\",\n    Parameters = BinaryData.FromString(\"\"\"\n        {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\n                    \"type\": \"string\",\n                    \"description\": \"The city and state or country\"\n                }\n            },\n            \"required\": [\"location\"]\n        }\n        \"\"\")\n};\n\n// Add to session options\nsessionOptions.Tools.Add(weatherFunction);\n\n// Handle function call in event loop\nif (serverEvent is SessionUpdateResponseFunctionCallArgumentsDone functionCall)\n{\n    if (functionCall.Name == \"get_current_weather\")\n    {\n        var parameters = JsonSerializer.Deserialize<Dictionary<string, string>>(functionCall.Arguments);\n        string location = parameters?[\"location\"] ?? \"\";\n        \n        // Call external service\n        string weatherInfo = $\"The weather in {location} is sunny, 75°F.\";\n        \n        // Send response\n        await session.AddItemAsync(new FunctionCallOutputItem(functionCall.CallId, weatherInfo));\n        await session.StartResponseAsync();\n    }\n}\n```\n\n## Voice Options\n\n| Voice Type | Class | Example |\n|------------|-------|---------|\n| Azure Standard | `AzureStandardVoice` | `\"en-US-AvaNeural\"` |\n| Azure HD | `AzureStandardVoice` | `\"en-US-Ava:DragonHDLatestNeural\"` |\n| Azure Custom | `AzureCustomVoice` | Custom voice with endpoint ID |\n\n## Supported Models\n\n| Model | Description |\n|-------|-------------|\n| `gpt-4o-realtime-preview` | GPT-4o with real-time audio |\n| `gpt-4o-mini-realtime-preview` | Lightweight, fast interactions |\n| `phi4-mm-realtime` | Cost-effective multimodal |\n\n## Key Types Reference\n\n| Type | Purpose |\n|------|---------|\n| `VoiceLiveClient` | Main client for creating sessions |\n| `VoiceLiveSession` | Active WebSocket session |\n| `VoiceLiveSessionOptions` | Session configuration |\n| `AzureStandardVoice` | Standard Azure voice provider |\n| `AzureSemanticVadTurnDetection` | Voice activity detection |\n| `VoiceLiveFunctionDefinition` | Function tool definition |\n| `UserMessageItem` | User text message |\n| `FunctionCallOutputItem` | Function call response |\n| `SessionUpdateResponseAudioDelta` | Audio chunk event |\n| `SessionUpdateResponseTextDelta` | Text chunk event |\n\n## Best Practices\n\n1. **Always set both modalities** — Include `Text` and `Audio` for voice assistants\n2. **Use `AzureSemanticVadTurnDetection`** — Provides natural conversation flow\n3. **Configure appropriate silence duration** — 500ms typical to avoid premature cutoffs\n4. **Use `using` statement** — Ensures proper session disposal\n5. **Handle all event types** — Check for errors, audio, text, and function calls\n6. **Use DefaultAzureCredential** — Never hardcode API keys\n\n## Error Handling\n\n```csharp\nif (serverEvent is SessionUpdateError error)\n{\n    if (error.Error.Message.Contains(\"Cancellation failed: no active response\"))\n    {\n        // Benign error, can ignore\n    }\n    else\n    {\n        Console.WriteLine($\"Error: {error.Error.Message}\");\n    }\n}\n```\n\n## Audio Configuration\n\n- **Input Format**: `InputAudioFormat.Pcm16` (16-bit PCM)\n- **Output Format**: `OutputAudioFormat.Pcm16`\n- **Sample Rate**: 24kHz recommended\n- **Channels**: Mono\n\n## Related SDKs\n\n| SDK | Purpose | Install |\n|-----|---------|---------|\n| `Azure.AI.VoiceLive` | Real-time voice (this SDK) | `dotnet add package Azure.AI.VoiceLive` |\n| `Microsoft.CognitiveServices.Speech` | Speech-to-text, text-to-speech | `dotnet add package Microsoft.CognitiveServices.Speech` |\n| `NAudio` | Audio capture/playback | `dotnet add package NAudio` |\n\n## Reference Links\n\n| Resource | URL |\n|----------|-----|\n| NuGet Package | https://www.nuget.org/packages/Azure.AI.VoiceLive |\n| API Reference | https://learn.microsoft.com/dotnet/api/azure.ai.voicelive |\n| GitHub Source | https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/ai/Azure.AI.VoiceLive |\n| Quickstart | https://learn.microsoft.com/azure/ai-services/speech-service/voice-live-quickstart |\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["azure","voicelive","dotnet","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding"],"capabilities":["skill","source-sickn33","skill-azure-ai-voicelive-dotnet","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/azure-ai-voicelive-dotnet","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34928 github stars · SKILL.md body (8,420 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-24T18:50:28.904Z","embedding":null,"createdAt":"2026-04-18T21:32:06.369Z","updatedAt":"2026-04-24T18:50:28.904Z","lastSeenAt":"2026-04-24T18:50:28.904Z","tsv":"'/azure/ai-services/speech-service/voice-live-quickstart':706 '/azure/azure-sdk-for-net/tree/main/sdk/ai/azure.ai.voicelive':702 '/dotnet/api/azure.ai.voicelive':697 '/packages/azure.ai.voicelive':692 '0.5':240 '1':172,550 '16':636 '2':269,562 '24khz':644 '3':327,569 '300':244 '4':343,580 '4o':75,201,473,478,486 '5':588 '500':247 '500ms':574 '6':601 '75':426 'access':131 'action':719 'activ':513,526,621 'add':43,47,51,382,661,674,681 'additemasync':165 'ai':3,7,18,30,39,225 'alway':551 'api':86,95,133,147,606,693 'applic':19,713 'appropri':571 'ask':757 'assign':127 'assist':36,226,260,561 'audio':55,257,288,293,483,541,558,596,631,678 'audiodata':285 'audiodelta':283 'audiodelta.delta.toarray':286 'authent':97 'ava':457 'avaneur':84,235,450 'avoid':577 'await':210,266,273,332,341,430,436 'azur':2,6,38,66,70,78,93,129,187,444,451,459,521 'azure-ai-voicelive-dotnet':1 'azure.ai.voicelive':24,45,106,181,653,663 'azure.identity':49,104,179 'azurecustomvoic':461 'azurekeycredenti':141,144 'azuresemanticvadturndetect':238,524,564 'azurestandardvoic':231,446,453,519 'bash':41,65 'benign':623 'best':548 'bidirect':21,34 'binarydata.fromstring':366 'bit':637 'boundari':765 'break':295,301,312,319,326 'build':13,33 'byte':284 'call':307,310,345,390,415,538,600 'cancel':618 'capture/playback':56,679 'case':281,296,302,313,320 'channel':646 'check':593 'chunk':542,546 'citi':375 'clarif':759 'class':442 'clear':732 'client':117,150,155,191,508 'client.startsessionasync':211 'cognit':124 'communic':23 'complet':325 'configur':176,213,518,570,632 'configuresessionasync':161 'connect':160 'console.write':299 'console.writeline':316,322,628 'control':132 'convers':567 'core':170 'cost':498 'cost-effect':497 'countri':379 'creat':510 'credenti':113,121,142,154 'criteria':768 'csharp':102,135,177,272,331,346,610 'current':57,354,359,402 'custom':460,462 'cutoff':579 'defaultazurecredenti':112,115,196,603 'defin':347 'definit':531 'describ':720,736 'descript':356,373,470 'detect':527 'dictionari':407 'dispos':587 'dotnet':5,42,46,50,660,673,680 'dragonhdlatestneur':458 'durat':573 'effect':499 'els':627 'en':82,233,448,455 'en-us-ava':454 'en-us-avaneur':81,232,447 'endpoint':68,108,120,137,153,183,189,194,465 'ensur':584 'entra':91,99 'environ':63,748 'environment-specif':747 'environment.getenvironmentvariable':186 'error':315,317,595,608,615,624,629 'error.error.message':318,630 'error.error.message.contains':617 'event':164,271,392,543,547,591 'exampl':443 'execut':715 'expert':753 'extern':416 'f':241,427 'fail':619 'fast':491 'flow':568 'foreach':274 'format':634,640 'function':306,309,344,348,389,529,537,599 'functioncal':304,398 'functioncall.arguments':410 'functioncall.callid':434 'functioncall.name':400 'functioncalloutputitem':167,433,536 'get':353,357,401 'getupdatesasync':162 'github':698 'github.com':701 'github.com/azure/azure-sdk-for-net/tree/main/sdk/ai/azure.ai.voicelive':700 'given':363 'gpt':74,200,472,477,485 'gpt-4o':476 'gpt-4o-mini-realtime-preview':199,484 'gpt-4o-realtime-preview':73,471 'handl':305,388,589,609 'hardcod':605 'hd':452 'hello':336 'help':224,339 'hierarchi':156 'id':92,100,466 'ignor':626 'includ':555 'input':633,762 'inputaudioformat':248 'inputaudioformat.pcm16':249,635 'instal':40,652 'instruct':220 'interact':492 'interactionmodality.audio':265 'interactionmodality.text':263 'jsonserializer.deserialize':406 'key':87,96,134,148,501,607 'learn.microsoft.com':696,705 'learn.microsoft.com/azure/ai-services/speech-service/voice-live-quickstart':704 'learn.microsoft.com/dotnet/api/azure.ai.voicelive':695 'librari':294 'lightweight':490 'limit':724 'link':685 'live':9 'locat':364,370,381,412,414,423 'loop':393 'main':507 'match':733 'messag':330,535 'microsoft':98 'microsoft.cognitiveservices.speech':664,676 'mini':202,487 'miss':770 'mm':495 'modal':253,554 'model':72,198,212,218,219,468,469 'mono':647 'multimod':500 'n':323 'natur':228,566 'naudio':53,290,677,683 'net':12,25 'never':604 'new':109,114,118,138,143,151,184,192,195,217,230,237,334,351,432 'nuget':688 'object':368 'option':85,385,439 'output':639,742 'outputaudioformat':250 'outputaudioformat.pcm16':251,641 'overview':723 'packag':44,48,52,662,675,682,689 'paramet':365,405,413 'pcm':638 'permiss':763 'phi4':494 'phi4-mm-realtime':493 'play':287 'portal':130 'practic':549 'prefixpad':242 'prematur':578 'preview':61,77,204,475,489 'process':270 'proper':585 'properti':369 'provid':523,565 'purpos':505,651 'quickstart':703 'rate':643 'real':15,27,481,655 'real-tim':14,26,480,654 'realtim':76,203,474,488,496 'recommend':101,645 'refer':503,684,694 'relat':648 'requir':122,380,761 'resourc':686 'respond':227 'respons':324,429,539,622 'review':754 'role':123 'safeti':764 'sampl':642 'scope':735 'sdk':10,31,650,659 'sdks':649 'section':311 'see':308 'send':328,428 'sendaudioasync':168 'serverev':276,280,395,612 'servic':125,417 'services.ai.azure.com':69 'session':174,206,209,214,384,511,515,517,586 'session.additemasync':333,431 'session.configuresessionasync':267 'session.getupdatesasync':278 'session.startresponseasync':342,437 'sessionopt':216,268 'sessionoptions.modalities.add':262,264 'sessionoptions.modalities.clear':261 'sessionoptions.tools.add':386 'sessionupd':163,275 'sessionupdateerror':314,614 'sessionupdateresponseaudiodelta':282,540 'sessionupdateresponsedon':321 'sessionupdateresponsefunctioncallargumentsdon':303,397 'sessionupdateresponsetextdelta':297,544 'set':252,552 'silenc':572 'silencedur':245 'skill':711,727 'skill-azure-ai-voicelive-dotnet' 'sourc':699 'source-sickn33' 'specif':749 'speech':666,672 'speech-to-text':665 'stabl':59 'standard':445,520 'start':173,205 'startresponseasync':169 'state':377 'statement':583 'stop':755 'string':372,408,409,411,418 'substitut':745 'success':767 'sunni':425 'support':467 'switch':279 'task':731 'test':751 'text':255,534,545,556,597,668,670 'text-to-speech':669 'textdelta':298 'textdelta.delta':300 'threshold':239 'time':16,28,482,656 'timespan.frommilliseconds':243,246 'tool':530 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'treat':740 'turndetect':236 'type':367,371,441,502,504,592 'typic':575 'uri':107,110,136,139,185 'url':687 'us':83,234,449,456 'use':90,103,105,178,180,207,563,581,582,602,709,725 'user':126,329,533 'usermessageitem':166,335,532 'v1.0.0':60 'v1.1.0-beta.1':62 'valid':750 'var':182,190,197,349,404 'variabl':64 'version':58 'via':289 'voic':8,17,29,35,80,229,259,438,440,463,522,525,560,657 'voicel':4,67,71,79,94,188 'voicelivecli':116,119,149,152,157,193,506 'voicelivefunctiondefinit':352,528 'voicelivesess':158,208,512 'voicelivesessionopt':215,516 'weather':355,360,403,421 'weatherfunct':350,387 'weatherinfo':419,435 'websocket':22,159,514 'workflow':171,717 'www.nuget.org':691 'www.nuget.org/packages/azure.ai.voicelive':690 'your-api-key':145 'your-resource.cognitiveservices.azure.com':111,140","prices":[{"id":"c93a86d4-4bf8-4699-95b0-745979bd5b10","listingId":"f0be5ad1-91f7-46e6-9582-5c39fa0cdc46","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:32:06.369Z"}],"sources":[{"listingId":"f0be5ad1-91f7-46e6-9582-5c39fa0cdc46","source":"github","sourceId":"sickn33/antigravity-awesome-skills/azure-ai-voicelive-dotnet","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-ai-voicelive-dotnet","isPrimary":false,"firstSeenAt":"2026-04-18T21:32:06.369Z","lastSeenAt":"2026-04-24T18:50:28.904Z"}],"details":{"listingId":"f0be5ad1-91f7-46e6-9582-5c39fa0cdc46","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"azure-ai-voicelive-dotnet","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34928,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-24T06:41:17Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"e9c3140f22f0ba283ff205ffb0e9b00f6840cf11","skill_md_path":"skills/azure-ai-voicelive-dotnet/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-ai-voicelive-dotnet"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"azure-ai-voicelive-dotnet","description":"Azure AI Voice Live SDK for .NET. Build real-time voice AI applications with bidirectional WebSocket communication."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/azure-ai-voicelive-dotnet"},"updatedAt":"2026-04-24T18:50:28.904Z"}}