brokenchapt3r/astralnexus/azure-ai-voicelive-py
Claude Code and agent skill by brokenchapt3r/astralnexus
- community
Checking that the SKILL.md file is still in the repository.
Build real-time voice AI applications using Azure AI Voice Live SDK (azure-ai-voicelive). Use this skill when creating Python applications that need real-time bidirectional audio communication with Azure AI, including voice assistants, voice-enabled chatbots, real-time speech-to-speech translation, voice-driven avatars, or any WebSocket-based audio streaming with AI models. Supports Server VAD (Voice Activity Detection), turn-based conversation, function calling, MCP tools, avatar integration,…
Install
npx vskill@latest install brokenchapt3r/astralnexus/azure-ai-voicelive-pySKILL.md
The same SKILL.md was published earlier as gunnerylee4756/gunnerylee4756/azure-ai-voicelive-py.
Azure AI Voice Live SDK
Build real-time voice AI applications with bidirectional WebSocket communication.
Installation
Environment Variables
Authentication & Lifecycle
🔑 Two rules apply to every code sample below:1. Prefer `DefaultAzureCredential`. It works locally (Azure CLI / VS Code / Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account/API keys — they bypass Entra audit and rotation.- Local dev:DefaultAzureCredentialworks as-is.- Production: setAZURE_TOKEN_CREDENTIALS=prod(orAZURE_TOKEN_CREDENTIALS=<specific_credential>) to constrain the credential chain to production-safe credentials.2. Wrap every client in a context manager so HTTP transports, sockets, and token caches are released deterministically:- Sync:with <Client>(...) as client:- Async:async with <Client>(...) as client:andasync with DefaultAzureCredential() as credential:(fromazure.identity.aio)Snippets may abbreviate this setup, but production code should always follow both rules.
Legacy: API Key (existing keyed deployments)
New code should use DefaultAzureCredential above. Use AzureKeyCredential only if you have an existing keyed deployment that hasn't been migrated to Entra ID yet — for example, regulated environments still completing their Entra rollout.
Quick Start
Core Architecture
Connection Resources
The VoiceLiveConnection exposes these resources:
| Resource | Purpose | Key Methods | |
|---|---|---|---|
conn.session | Session configuration | update(session=...) | |
conn.response | Model responses | create(), cancel() | |
conn.input_audio_buffer | Audio input | append(), commit(), clear() | |
conn.output_audio_buffer | Audio output | clear() | |
conn.conversation | Conversation state | item.create(), item.delete(), item.truncate() | |
conn.transcription_session | Transcription config | update(session=...) |
Session Configuration
Audio Streaming
Send Audio (Base64 PCM16)
Receive Audio
Event Handling
Common Patterns
Manual Turn Mode (No VAD)
Interrupt Handling
Conversation History
Voice Options
| Voice | Description | |
|---|---|---|
alloy | Neutral, balanced | |
echo | Warm, conversational | |
shimmer | Clear, professional | |
sage | Calm, authoritative | |
coral | Friendly, upbeat | |
ash | Deep, measured | |
ballad | Expressive | |
verse | Storytelling |
Azure voices: Use AzureStandardVoice, AzureCustomVoice, or AzurePersonalVoice models.
Audio Formats
| Format | Sample Rate | Use Case | |
|---|---|---|---|
pcm16 | 24kHz | Default, high quality | |
pcm16-8000hz | 8kHz | Telephony | |
pcm16-16000hz | 16kHz | Voice assistants | |
g711_ulaw | 8kHz | Telephony (US) | |
g711_alaw | 8kHz | Telephony (EU) |
Turn Detection Options
Error Handling
Best Practices
- This SDK is async-only; use the `.aio` namespace throughout. Do not try to pair it with sync clients from other Azure SDKs in the same call path — keep the whole request path async.
- Always use context managers for clients and async credentials. Wrap every connection in
async with connect(...) as conn:. For asyncDefaultAzureCredentialfromazure.identity.aio, also useasync with credential:so tokens and transports are cleaned up.
References
- Detailed API Reference: See references/api-reference.md
- Complete Examples: See references/examples.md
- All Models & Types: See references/models.md
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/AstralNexus/skills/vendor/microsoft/azure-ai-voicelive-py/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/brokenchapt3r/astralnexus/azure-ai-voicelive-py)