[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69ARSFKPFPN83ARY2WN0VN9":3,"skill-same:01M69ARSFKPFPN83ARY2WN0VN9":95},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":57,"commitSha":58,"skillDirectory":59,"forksCount":60,"repositoryHtmlUrl":61,"repositoryHomepageUrl":62,"ownerHtmlUrl":63,"ownerBlogUrl":64,"ownerDescription":65,"updatedAt":66,"install":67,"resources":80},"01M69ARSFKPFPN83ARY2WN0VN9","azure-ai-voicelive-py",null,"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, and transcription.","microsoft\u002Fskills","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69AJYYW4E1RMSYCQDJ4FJSH",3192,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fazure-sdk-python\u002Fskills\u002Fazure-ai-voicelive-py\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,9,47,48],"azure ai","azure","azure ai voicelive py","Tools","when","activity","ai models","vad","live","time","translation","conversation","Audio","real-time","websocket","MCP","server","streaming","speech","communication","sdk","python","2026-11-10 10:12:30",false,"---\nname: azure-ai-voicelive-py\ndescription: 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, and transcription.\nlicense: MIT\nmetadata:\n  author: Microsoft\n  version: \"1.0.0\"\n  package: azure-ai-voicelive\n---\n\n# Azure AI Voice Live SDK\n\nBuild real-time voice AI applications with bidirectional WebSocket communication.\n\n## Installation\n\n```bash\npip install azure-ai-voicelive aiohttp azure-identity\n```\n\n## Environment Variables\n\n```bash\nAZURE_COGNITIVE_SERVICES_ENDPOINT=https:\u002F\u002F\u003Cregion>.api.cognitive.microsoft.com  # Required for all auth methods\nAZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production\nAZURE_COGNITIVE_SERVICES_KEY=\u003Capi-key>  # Only required for the legacy API-key auth path below\n```\n\n## Authentication & Lifecycle\n\n> **? Two rules apply to every code sample below:**\n>\n> 1. **Prefer `DefaultAzureCredential`.** It works locally (Azure CLI \u002F VS Code \u002F Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account\u002FAPI keys — they bypass Entra audit and rotation.\n>    - Local dev: `DefaultAzureCredential` works as-is.\n>    - Production: set `AZURE_TOKEN_CREDENTIALS=prod` (or `AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>`) to constrain the credential chain to production-safe credentials.\n> 2. **Wrap every client in a context manager** so HTTP transports, sockets, and token caches are released deterministically:\n>    - Sync: `with \u003CClient>(...) as client:`\n>    - Async: `async with \u003CClient>(...) as client:` **and** `async with DefaultAzureCredential() as credential:` (from `azure.identity.aio`)\n>\n> Snippets may abbreviate this setup, but production code should always follow both rules.\n\n```python\nimport os\nfrom azure.ai.voicelive.aio import connect\nfrom azure.identity.aio import DefaultAzureCredential, ManagedIdentityCredential\n\n# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>\n# Or use a specific credential directly in production:\n# See https:\u002F\u002Flearn.microsoft.com\u002Fpython\u002Fapi\u002Foverview\u002Fazure\u002Fidentity-readme?view=azure-python#credential-classes\n# credential = ManagedIdentityCredential()\n\nasync with DefaultAzureCredential(require_envvar=True) as credential:\n    async with connect(\n        endpoint=os.environ[\"AZURE_COGNITIVE_SERVICES_ENDPOINT\"],\n        credential=credential,\n        model=\"gpt-4o-realtime-preview\",\n        credential_scopes=[\"https:\u002F\u002Fcognitiveservices.azure.com\u002F.default\"]\n    ) as conn:\n        ...\n```\n\n### Legacy: API Key (existing keyed deployments)\n\nNew 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.\n\n```python\nimport os\nfrom azure.core.credentials import AzureKeyCredential\nfrom azure.ai.voicelive.aio import connect\n\nasync with connect(\n    endpoint=os.environ[\"AZURE_COGNITIVE_SERVICES_ENDPOINT\"],\n    credential=AzureKeyCredential(os.environ[\"AZURE_COGNITIVE_SERVICES_KEY\"]),\n    model=\"gpt-4o-realtime-preview\",\n) as conn:\n    ...\n```\n\n## Quick Start\n\n```python\nimport asyncio\nimport os\nfrom azure.ai.voicelive.aio import connect\nfrom azure.identity.aio import DefaultAzureCredential\n\nasync def main():\n    async with connect(\n        endpoint=os.environ[\"AZURE_COGNITIVE_SERVICES_ENDPOINT\"],\n        credential=DefaultAzureCredential(),\n        model=\"gpt-4o-realtime-preview\",\n        credential_scopes=[\"https:\u002F\u002Fcognitiveservices.azure.com\u002F.default\"]\n    ) as conn:\n        # Update session with instructions\n        await conn.session.update(session={\n            \"instructions\": \"You are a helpful assistant.\",\n            \"modalities\": [\"text\", \"audio\"],\n            \"voice\": \"alloy\"\n        })\n        \n        # Listen for events\n        async for event in conn:\n            print(f\"Event: {event.type}\")\n            if event.type == \"response.audio_transcript.done\":\n                print(f\"Transcript: {event.transcript}\")\n            elif event.type == \"response.done\":\n                break\n\nasyncio.run(main())\n```\n\n## Core Architecture\n\n### Connection Resources\n\nThe `VoiceLiveConnection` exposes these resources:\n\n| Resource | Purpose | Key Methods |\n|----------|---------|-------------|\n| `conn.session` | Session configuration | `update(session=...)` |\n| `conn.response` | Model responses | `create()`, `cancel()` |\n| `conn.input_audio_buffer` | Audio input | `append()`, `commit()`, `clear()` |\n| `conn.output_audio_buffer` | Audio output | `clear()` |\n| `conn.conversation` | Conversation state | `item.create()`, `item.delete()`, `item.truncate()` |\n| `conn.transcription_session` | Transcription config | `update(session=...)` |\n\n## Session Configuration\n\n```python\nfrom azure.ai.voicelive.models import RequestSession, FunctionTool\n\nawait conn.session.update(session=RequestSession(\n    instructions=\"You are a helpful voice assistant.\",\n    modalities=[\"text\", \"audio\"],\n    voice=\"alloy\",  # or \"echo\", \"shimmer\", \"sage\", etc.\n    input_audio_format=\"pcm16\",\n    output_audio_format=\"pcm16\",\n    turn_detection={\n        \"type\": \"server_vad\",\n        \"threshold\": 0.5,\n        \"prefix_padding_ms\": 300,\n        \"silence_duration_ms\": 500\n    },\n    tools=[\n        FunctionTool(\n            type=\"function\",\n            name=\"get_weather\",\n            description=\"Get current weather\",\n            parameters={\n                \"type\": \"object\",\n                \"properties\": {\n                    \"location\": {\"type\": \"string\"}\n                },\n                \"required\": [\"location\"]\n            }\n        )\n    ]\n))\n```\n\n## Audio Streaming\n\n### Send Audio (Base64 PCM16)\n\n```python\nimport base64\n\n# Read audio chunk (16-bit PCM, 24kHz mono)\naudio_chunk = await read_audio_from_microphone()\nb64_audio = base64.b64encode(audio_chunk).decode()\n\nawait conn.input_audio_buffer.append(audio=b64_audio)\n```\n\n### Receive Audio\n\n```python\nasync for event in conn:\n    if event.type == \"response.audio.delta\":\n        audio_bytes = base64.b64decode(event.delta)\n        await play_audio(audio_bytes)\n    elif event.type == \"response.audio.done\":\n        print(\"Audio complete\")\n```\n\n## Event Handling\n\n```python\nasync for event in conn:\n    match event.type:\n        # Session events\n        case \"session.created\":\n            print(f\"Session: {event.session}\")\n        case \"session.updated\":\n            print(\"Session updated\")\n        \n        # Audio input events\n        case \"input_audio_buffer.speech_started\":\n            print(f\"Speech started at {event.audio_start_ms}ms\")\n        case \"input_audio_buffer.speech_stopped\":\n            print(f\"Speech stopped at {event.audio_end_ms}ms\")\n        \n        # Transcription events\n        case \"conversation.item.input_audio_transcription.completed\":\n            print(f\"User said: {event.transcript}\")\n        case \"conversation.item.input_audio_transcription.delta\":\n            print(f\"Partial: {event.delta}\")\n        \n        # Response events\n        case \"response.created\":\n            print(f\"Response started: {event.response.id}\")\n        case \"response.audio_transcript.delta\":\n            print(event.delta, end=\"\", flush=True)\n        case \"response.audio.delta\":\n            audio = base64.b64decode(event.delta)\n        case \"response.done\":\n            print(f\"Response complete: {event.response.status}\")\n        \n        # Function calls\n        case \"response.function_call_arguments.done\":\n            result = handle_function(event.name, event.arguments)\n            await conn.conversation.item.create(item={\n                \"type\": \"function_call_output\",\n                \"call_id\": event.call_id,\n                \"output\": json.dumps(result)\n            })\n            await conn.response.create()\n        \n        # Errors\n        case \"error\":\n            print(f\"Error: {event.error.message}\")\n```\n\n## Common Patterns\n\n### Manual Turn Mode (No VAD)\n\n```python\nawait conn.session.update(session={\"turn_detection\": None})\n\n# Manually control turns\nawait conn.input_audio_buffer.append(audio=b64_audio)\nawait conn.input_audio_buffer.commit()  # End of user turn\nawait conn.response.create()  # Trigger response\n```\n\n### Interrupt Handling\n\n```python\nasync for event in conn:\n    if event.type == \"input_audio_buffer.speech_started\":\n        # User interrupted - cancel current response\n        await conn.response.cancel()\n        await conn.output_audio_buffer.clear()\n```\n\n### Conversation History\n\n```python\n# Add system message\nawait conn.conversation.item.create(item={\n    \"type\": \"message\",\n    \"role\": \"system\",\n    \"content\": [{\"type\": \"input_text\", \"text\": \"Be concise.\"}]\n})\n\n# Add user message\nawait conn.conversation.item.create(item={\n    \"type\": \"message\",\n    \"role\": \"user\", \n    \"content\": [{\"type\": \"input_text\", \"text\": \"Hello!\"}]\n})\n\nawait conn.response.create()\n```\n\n## Voice Options\n\n| Voice | Description |\n|-------|-------------|\n| `alloy` | Neutral, balanced |\n| `echo` | Warm, conversational |\n| `shimmer` | Clear, professional |\n| `sage` | Calm, authoritative |\n| `coral` | Friendly, upbeat |\n| `ash` | Deep, measured |\n| `ballad` | Expressive |\n| `verse` | Storytelling |\n\nAzure voices: Use `AzureStandardVoice`, `AzureCustomVoice`, or `AzurePersonalVoice` models.\n\n## Audio Formats\n\n| Format | Sample Rate | Use Case |\n|--------|-------------|----------|\n| `pcm16` | 24kHz | Default, high quality |\n| `pcm16-8000hz` | 8kHz | Telephony |\n| `pcm16-16000hz` | 16kHz | Voice assistants |\n| `g711_ulaw` | 8kHz | Telephony (US) |\n| `g711_alaw` | 8kHz | Telephony (EU) |\n\n## Turn Detection Options\n\n```python\n# Server VAD (default)\n{\"type\": \"server_vad\", \"threshold\": 0.5, \"silence_duration_ms\": 500}\n\n# Azure Semantic VAD (smarter detection)\n{\"type\": \"azure_semantic_vad\"}\n{\"type\": \"azure_semantic_vad_en\"}  # English optimized\n{\"type\": \"azure_semantic_vad_multilingual\"}\n```\n\n## Error Handling\n\n```python\nfrom azure.ai.voicelive.aio import ConnectionError, ConnectionClosed\n\ntry:\n    async with connect(...) as conn:\n        async for event in conn:\n            if event.type == \"error\":\n                print(f\"API Error: {event.error.code} - {event.error.message}\")\nexcept ConnectionClosed as e:\n    print(f\"Connection closed: {e.code} - {e.reason}\")\nexcept ConnectionError as e:\n    print(f\"Connection error: {e}\")\n```\n\n## Best Practices\n\n1. **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.\n2. **Always use context managers for clients and async credentials.** Wrap every connection in `async with connect(...) as conn:`. For async `DefaultAzureCredential` from `azure.identity.aio`, also use `async with credential:` so tokens and transports are cleaned up.\n\n## References\n\n- **Detailed API Reference**: See [references\u002Fapi-reference.md](references\u002Fapi-reference.md)\n- **Complete Examples**: See [references\u002Fexamples.md](references\u002Fexamples.md)\n- **All Models & Types**: See [references\u002Fmodels.md](references\u002Fmodels.md)\n","# Azure AI Voice Live SDK\n\nBuild real-time voice AI applications with bidirectional WebSocket communication.\n\n## Installation\n\n```bash\npip install azure-ai-voicelive aiohttp azure-identity\n```\n\n## Environment Variables\n\n```bash\nAZURE_COGNITIVE_SERVICES_ENDPOINT=https:\u002F\u002F\u003Cregion>.api.cognitive.microsoft.com  # Required for all auth methods\nAZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production\nAZURE_COGNITIVE_SERVICES_KEY=\u003Capi-key>  # Only required for the legacy API-key auth path below\n```\n\n## Authentication & Lifecycle\n\n> **? Two rules apply to every code sample below:**\n>\n> 1. **Prefer `DefaultAzureCredential`.** It works locally (Azure CLI \u002F VS Code \u002F Developer CLI) and in Azure (managed identity, workload identity) with no code change. Avoid connection strings, account\u002FAPI keys — they bypass Entra audit and rotation.\n>    - Local dev: `DefaultAzureCredential` works as-is.\n>    - Production: set `AZURE_TOKEN_CREDENTIALS=prod` (or `AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>`) to constrain the credential chain to production-safe credentials.\n> 2. **Wrap every client in a context manager** so HTTP transports, sockets, and token caches are released deterministically:\n>    - Sync: `with \u003CClient>(...) as client:`\n>    - Async: `async with \u003CClient>(...) as client:` **and** `async with DefaultAzureCredential() as credential:` (from `azure.identity.aio`)\n>\n> Snippets may abbreviate this setup, but production code should always follow both rules.\n\n```python\nimport os\nfrom azure.ai.voicelive.aio import connect\nfrom azure.identity.aio import DefaultAzureCredential, ManagedIdentityCredential\n\n# Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=\u003Cspecific_credential>\n# Or use a specific credential directly in production:\n# See https:\u002F\u002Flearn.microsoft.com\u002Fpython\u002Fapi\u002Foverview\u002Fazure\u002Fidentity-readme?view=azure-python#credential-classes\n# credential = ManagedIdentityCredential()\n\nasync with DefaultAzureCredential(require_envvar=True) as credential:\n    async with connect(\n        endpoint=os.environ[\"AZURE_COGNITIVE_SERVICES_ENDPOINT\"],\n        credential=credential,\n        model=\"gpt-4o-realtime-preview\",\n        credential_scopes=[\"https:\u002F\u002Fcognitiveservices.azure.com\u002F.default\"]\n    ) as conn:\n        ...\n```\n\n### Legacy: API Key (existing keyed deployments)\n\nNew 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.\n\n```python\nimport os\nfrom azure.core.credentials import AzureKeyCredential\nfrom azure.ai.voicelive.aio import connect\n\nasync with connect(\n    endpoint=os.environ[\"AZURE_COGNITIVE_SERVICES_ENDPOINT\"],\n    credential=AzureKeyCredential(os.environ[\"AZURE_COGNITIVE_SERVICES_KEY\"]),\n    model=\"gpt-4o-realtime-preview\",\n) as conn:\n    ...\n```\n\n## Quick Start\n\n```python\nimport asyncio\nimport os\nfrom azure.ai.voicelive.aio import connect\nfrom azure.identity.aio import DefaultAzureCredential\n\nasync def main():\n    async with connect(\n        endpoint=os.environ[\"AZURE_COGNITIVE_SERVICES_ENDPOINT\"],\n        credential=DefaultAzureCredential(),\n        model=\"gpt-4o-realtime-preview\",\n        credential_scopes=[\"https:\u002F\u002Fcognitiveservices.azure.com\u002F.default\"]\n    ) as conn:\n        # Update session with instructions\n        await conn.session.update(session={\n            \"instructions\": \"You are a helpful assistant.\",\n            \"modalities\": [\"text\", \"audio\"],\n            \"voice\": \"alloy\"\n        })\n        \n        # Listen for events\n        async for event in conn:\n            print(f\"Event: {event.type}\")\n            if event.type == \"response.audio_transcript.done\":\n                print(f\"Transcript: {event.transcript}\")\n            elif event.type == \"response.done\":\n                break\n\nasyncio.run(main())\n```\n\n## Core Architecture\n\n### Connection Resources\n\nThe `VoiceLiveConnection` exposes these resources:\n\n| Resource | Purpose | Key Methods |\n|----------|---------|-------------|\n| `conn.session` | Session configuration | `update(session=...)` |\n| `conn.response` | Model responses | `create()`, `cancel()` |\n| `conn.input_audio_buffer` | Audio input | `append()`, `commit()`, `clear()` |\n| `conn.output_audio_buffer` | Audio output | `clear()` |\n| `conn.conversation` | Conversation state | `item.create()`, `item.delete()`, `item.truncate()` |\n| `conn.transcription_session` | Transcription config | `update(session=...)` |\n\n## Session Configuration\n\n```python\nfrom azure.ai.voicelive.models import RequestSession, FunctionTool\n\nawait conn.session.update(session=RequestSession(\n    instructions=\"You are a helpful voice assistant.\",\n    modalities=[\"text\", \"audio\"],\n    voice=\"alloy\",  # or \"echo\", \"shimmer\", \"sage\", etc.\n    input_audio_format=\"pcm16\",\n    output_audio_format=\"pcm16\",\n    turn_detection={\n        \"type\": \"server_vad\",\n        \"threshold\": 0.5,\n        \"prefix_padding_ms\": 300,\n        \"silence_duration_ms\": 500\n    },\n    tools=[\n        FunctionTool(\n            type=\"function\",\n            name=\"get_weather\",\n            description=\"Get current weather\",\n            parameters={\n                \"type\": \"object\",\n                \"properties\": {\n                    \"location\": {\"type\": \"string\"}\n                },\n                \"required\": [\"location\"]\n            }\n        )\n    ]\n))\n```\n\n## Audio Streaming\n\n### Send Audio (Base64 PCM16)\n\n```python\nimport base64\n\n# Read audio chunk (16-bit PCM, 24kHz mono)\naudio_chunk = await read_audio_from_microphone()\nb64_audio = base64.b64encode(audio_chunk).decode()\n\nawait conn.input_audio_buffer.append(audio=b64_audio)\n```\n\n### Receive Audio\n\n```python\nasync for event in conn:\n    if event.type == \"response.audio.delta\":\n        audio_bytes = base64.b64decode(event.delta)\n        await play_audio(audio_bytes)\n    elif event.type == \"response.audio.done\":\n        print(\"Audio complete\")\n```\n\n## Event Handling\n\n```python\nasync for event in conn:\n    match event.type:\n        # Session events\n        case \"session.created\":\n            print(f\"Session: {event.session}\")\n        case \"session.updated\":\n            print(\"Session updated\")\n        \n        # Audio input events\n        case \"input_audio_buffer.speech_started\":\n            print(f\"Speech started at {event.audio_start_ms}ms\")\n        case \"input_audio_buffer.speech_stopped\":\n            print(f\"Speech stopped at {event.audio_end_ms}ms\")\n        \n        # Transcription events\n        case \"conversation.item.input_audio_transcription.completed\":\n            print(f\"User said: {event.transcript}\")\n        case \"conversation.item.input_audio_transcription.delta\":\n            print(f\"Partial: {event.delta}\")\n        \n        # Response events\n        case \"response.created\":\n            print(f\"Response started: {event.response.id}\")\n        case \"response.audio_transcript.delta\":\n            print(event.delta, end=\"\", flush=True)\n        case \"response.audio.delta\":\n            audio = base64.b64decode(event.delta)\n        case \"response.done\":\n            print(f\"Response complete: {event.response.status}\")\n        \n        # Function calls\n        case \"response.function_call_arguments.done\":\n            result = handle_function(event.name, event.arguments)\n            await conn.conversation.item.create(item={\n                \"type\": \"function_call_output\",\n                \"call_id\": event.call_id,\n                \"output\": json.dumps(result)\n            })\n            await conn.response.create()\n        \n        # Errors\n        case \"error\":\n            print(f\"Error: {event.error.message}\")\n```\n\n## Common Patterns\n\n### Manual Turn Mode (No VAD)\n\n```python\nawait conn.session.update(session={\"turn_detection\": None})\n\n# Manually control turns\nawait conn.input_audio_buffer.append(audio=b64_audio)\nawait conn.input_audio_buffer.commit()  # End of user turn\nawait conn.response.create()  # Trigger response\n```\n\n### Interrupt Handling\n\n```python\nasync for event in conn:\n    if event.type == \"input_audio_buffer.speech_started\":\n        # User interrupted - cancel current response\n        await conn.response.cancel()\n        await conn.output_audio_buffer.clear()\n```\n\n### Conversation History\n\n```python\n# Add system message\nawait conn.conversation.item.create(item={\n    \"type\": \"message\",\n    \"role\": \"system\",\n    \"content\": [{\"type\": \"input_text\", \"text\": \"Be concise.\"}]\n})\n\n# Add user message\nawait conn.conversation.item.create(item={\n    \"type\": \"message\",\n    \"role\": \"user\", \n    \"content\": [{\"type\": \"input_text\", \"text\": \"Hello!\"}]\n})\n\nawait conn.response.create()\n```\n\n## Voice Options\n\n| Voice | Description |\n|-------|-------------|\n| `alloy` | Neutral, balanced |\n| `echo` | Warm, conversational |\n| `shimmer` | Clear, professional |\n| `sage` | Calm, authoritative |\n| `coral` | Friendly, upbeat |\n| `ash` | Deep, measured |\n| `ballad` | Expressive |\n| `verse` | Storytelling |\n\nAzure voices: Use `AzureStandardVoice`, `AzureCustomVoice`, or `AzurePersonalVoice` models.\n\n## Audio Formats\n\n| Format | Sample Rate | Use Case |\n|--------|-------------|----------|\n| `pcm16` | 24kHz | Default, high quality |\n| `pcm16-8000hz` | 8kHz | Telephony |\n| `pcm16-16000hz` | 16kHz | Voice assistants |\n| `g711_ulaw` | 8kHz | Telephony (US) |\n| `g711_alaw` | 8kHz | Telephony (EU) |\n\n## Turn Detection Options\n\n```python\n# Server VAD (default)\n{\"type\": \"server_vad\", \"threshold\": 0.5, \"silence_duration_ms\": 500}\n\n# Azure Semantic VAD (smarter detection)\n{\"type\": \"azure_semantic_vad\"}\n{\"type\": \"azure_semantic_vad_en\"}  # English optimized\n{\"type\": \"azure_semantic_vad_multilingual\"}\n```\n\n## Error Handling\n\n```python\nfrom azure.ai.voicelive.aio import ConnectionError, ConnectionClosed\n\ntry:\n    async with connect(...) as conn:\n        async for event in conn:\n            if event.type == \"error\":\n                print(f\"API Error: {event.error.code} - {event.error.message}\")\nexcept ConnectionClosed as e:\n    print(f\"Connection closed: {e.code} - {e.reason}\")\nexcept ConnectionError as e:\n    print(f\"Connection error: {e}\")\n```\n\n## Best Practices\n\n1. **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.\n2. **Always use context managers for clients and async credentials.** Wrap every connection in `async with connect(...) as conn:`. For async `DefaultAzureCredential` from `azure.identity.aio`, also use `async with credential:` so tokens and transports are cleaned up.\n\n## References\n\n- **Detailed API Reference**: See [references\u002Fapi-reference.md](references\u002Fapi-reference.md)\n- **Complete Examples**: See [references\u002Fexamples.md](references\u002Fexamples.md)\n- **All Models & Types**: See [references\u002Fmodels.md](references\u002Fmodels.md)\n",{"name":5,"license":15,"metadata":54,"description":7},{"author":12,"package":55,"version":56},"azure-ai-voicelive","1.0.0","main","3f5b461b2314e01c400564051e92469114c5b68f",".github\u002Fplugins\u002Fazure-sdk-python\u002Fskills\u002Fazure-ai-voicelive-py",364,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills","https:\u002F\u002Fmicrosoft.github.io\u002Fskills\u002F","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-11 02:03:22",{"source":8,"skillName":5,"commands":68,"prompt":78,"zipAvailable":79},[69,72,75],{"tool":70,"command":71},"npx","npx skills add microsoft\u002Fskills --skill azure-ai-voicelive-py",{"tool":73,"command":74},"bunx","bunx skills add microsoft\u002Fskills --skill azure-ai-voicelive-py",{"tool":76,"command":77},"pnpm","pnpm dlx skills add microsoft\u002Fskills --skill azure-ai-voicelive-py","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fazure-sdk-python\u002Fskills\u002Fazure-ai-voicelive-py\u002FSKILL.md",true,[81,87,91],{"path":82,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fapi-reference.md","REFERENCE","参考文档",8910,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fazure-sdk-python\u002Fskills\u002Fazure-ai-voicelive-py\u002Freferences\u002Fapi-reference.md",{"path":88,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fexamples.md",17345,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fazure-sdk-python\u002Fskills\u002Fazure-ai-voicelive-py\u002Freferences\u002Fexamples.md",{"path":92,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fmodels.md",18415,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fplugins\u002Fazure-sdk-python\u002Fskills\u002Fazure-ai-voicelive-py\u002Freferences\u002Fmodels.md",[96,120,153,179,198,235],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":103,"publishedAt":49},"01M69B4JCRQV5SPXAFCKXQRV0H","skill-creator","Guide for creating effective skills for AI coding agents working with Azure SDKs and Microsoft Foundry services. Use when creating new skills or updating existing skills.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fskill-creator\u002FSKILL.md",[102],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[104,105,106,9,107,108,109,28,110,111,112,113,114,115,116,117,118,31,119],"skill creator","creator","coding agents","foundry","microsoft foundry","ai coding agents","services","coding","guide","use","ai coding","with","sdks","for","Existing","new",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":134,"publishedAt":49},"01M69B4FD57V1MYKRWAJJECTZ7","podcast-generation","Generate AI-powered podcast-style audio narratives using Azure OpenAI's GPT Realtime Mini model via WebSocket. Use when building text-to-speech features, audio narrative generation, podcast creation from content, or integrating with Azure OpenAI Realtime API for real audio output. Covers full-stack implementation from React frontend to Python FastAPI backend with WebSocket streaming.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fpodcast-generation\u002FSKILL.md",[126,129,132,133],{"categoryNo":127,"categoryName":128,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":130,"categoryName":131,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[135,136,137,138,48,139,140,28,141,142,44,143,39,144,145,146,147,148,149,150,151,31,152],"podcast generation","podcast","generation","frontend","react","realtime","azure openai","generate","api","stack","text","model","fastapi","creation","python fastapi","narrative","features","fastapi backend",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":160,"publishedAt":49},"01M69B4CYPM5SESY5ZWEFDXEQZ","microsoft-docs","Understand Microsoft technologies by querying official documentation. Use whenever the user asks how something works, wants tutorials, needs configuration options, limits, quotas, or best practices for any Microsoft technology (Azure, .NET, M365, Windows, Power Platform, etc.)—even if they don't mention \"docs.\" If the question is about understanding a concept rather than writing code, this is the right skill.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fmicrosoft-docs\u002FSKILL.md",[159],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[161,9,162,42,163,164,165,166,167,168,169,28,170,171,172,113,173,70,174,175,176,177,178,117],"docs","microsoft docs","writing","cli","mcp server","windows","power platform","official","documentation","learn","best practices","question","power","back","technology","platform","learn mcp","concept",{"skillNo":180,"name":181,"nameZh":6,"description":182,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":183,"categories":184,"keywords":186,"publishedAt":49},"01M69B49C3YPD1ZJ3NC0HPCY58","mcp-builder","Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP), Node\u002FTypeScript (MCP SDK), or C#\u002F.NET (Microsoft MCP SDK).","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fmcp-builder\u002FSKILL.md",[185],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[42,187,188,189,48,190,47,191,9,192,30,146,193,194,112,113,195,196,197,115,117,31],"mcp builder","builder","typescript","llms","model context protocol","fastmcp","node","context","integrate","mcp sdk","building mcp servers",{"skillNo":199,"name":200,"nameZh":6,"description":201,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":202,"categories":203,"keywords":216,"publishedAt":49},"01M69B467A7CDMFQ0T6Q0ZA12Q","kql","KQL language expertise for writing correct, efficient Kusto Query Language queries. Covers syntax gotchas, join patterns, dynamic types, datetime pitfalls, regex patterns, serialization, memory management, result-size discipline, and advanced functions (geo, vector, graph). USE THIS SKILL whenever writing, debugging, or reviewing KQL queries — even simple ones — because the gotchas section prevents the most common errors that waste tool calls and cause expensive retry cascades. Trigger on: KQL, Kusto, ADX, Azure Data Explorer, Fabric Real-Time Intelligence, EventHouse, Log Analytics, log analysis, data exploration, time series, anomaly detection, summarize, where clause, join, extend, project, let statement, parse operator, extract function, any mention of pipe-forward query syntax.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fkql\u002FSKILL.md",[204,207,208,213],{"categoryNo":205,"categoryName":206,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":209,"categoryName":210,"taxonomyType":211,"taxonomyTypeDesc":212},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",{"categoryNo":214,"categoryName":215,"taxonomyType":211,"taxonomyTypeDesc":212},"01JBSEEDCAT000000000000036","内容创作者",[200,163,217,218,219,28,220,221,222,223,224,225,226,227,36,228,229,230,231,117,232,233,234],"summarize","memory","analytics","vector","time series","tool","discipline","log","geo","exploration","pipe","project","regex","join","datetime","section","anomaly","parse",{"skillNo":236,"name":237,"nameZh":6,"description":238,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":239,"categories":240,"keywords":241,"publishedAt":49},"01M69B44HJQ7897EZ7NE7DWQX3","github-issue-creator","Convert raw notes, error logs, voice dictation, or screenshots into crisp GitHub-flavored markdown issue reports. Use when the user pastes bug info, error messages, or informal descriptions and wants a structured GitHub issue. Supports images\u002FGIFs for visual evidence.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fgithub-issue-creator\u002FSKILL.md",[],[242,243,244,245,105,246,247,248,249,250,251,252,113,253,254,255,256,257,258,117,31],"github","github issue creator","github issue","issue","issue creator","screenshots","notes","logs","error messages","messages","convert","evidence","reports","images","info","visual","error"]