azure-ai-voicelive-dotnet 是什么?
该 Skill 介绍 Azure.AI.VoiceLive .NET SDK 的双向 WebSocket 会话:配置文本/音频模态和语音活动检测,消费文本/音频增量事件、接收用户消息,并处理工具调用。它面向实时交互程序,需要另外实现麦克风和音频播放。
中文说明由本站依据来源整理;英文原文保留在页面下方。
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
azure-ai-voicelive-dotnet,然后按本页使用示例提供材料。
展开并复制给 Codex 的安装指令
安装并检查 azure-ai-voicelive-dotnet
请在 Codex 的当前工作环境中安装并检查 azure-ai-voicelive-dotnet 这个 Skill。
项目身份:microsoft/skills / azure-ai-voicelive-dotnet
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-dotnet/skills/azure-ai-voicelive-dotnet/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-dotnet/skills/azure-ai-voicelive-dotnet/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 azure-ai-voicelive-dotnet
请在 Claude Code 的当前工作环境中安装并检查 azure-ai-voicelive-dotnet 这个 Skill。
项目身份:microsoft/skills / azure-ai-voicelive-dotnet
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-dotnet/skills/azure-ai-voicelive-dotnet/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-dotnet/skills/azure-ai-voicelive-dotnet/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 azure-ai-voicelive-dotnet
请在 Cursor Agent 的当前工作环境中安装并检查 azure-ai-voicelive-dotnet 这个 Skill。
项目身份:microsoft/skills / azure-ai-voicelive-dotnet
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-dotnet/skills/azure-ai-voicelive-dotnet/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-dotnet/skills/azure-ai-voicelive-dotnet/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 azure-ai-voicelive-dotnet
请在 当前 Agent 的当前工作环境中安装并检查 azure-ai-voicelive-dotnet 这个 Skill。
项目身份:microsoft/skills / azure-ai-voicelive-dotnet
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-dotnet/skills/azure-ai-voicelive-dotnet/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-dotnet/skills/azure-ai-voicelive-dotnet/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。装好以后,具体怎么用?
准备哪些材料
- 安装 Azure.AI.VoiceLive、Azure.Identity;捕获/播放音频可另用 NAudio。
- 配置 endpoint、部署模型和身份,并确认模型支持 Voice Live 与所在区域。Entra 身份需 Cognitive Services User 角色。
- 音频示例约定 PCM16、24kHz、单声道;检查设备采样与编码转换,不能直接把任意音频块当PCM16。
实际使用顺序
- 建立 VoiceLiveClient,启动会话并设置 modalities、voice、input/output format 与 turn detection。
- 消费 GetUpdatesAsync 事件循环,将文本与音频增量分别处理,订阅周期内保留 session。
- 发送 UserMessageItem 后调用 StartResponseAsync;接入麦克风时按帧格式连续送音频,并处理取消、结束和中断。
- 收到 function-call arguments 后校验 schema/权限、调用真实业务函数,再以 FunctionCallOutputItem 返回结果并启动续答。
从一个具体任务开始
本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。
复制一个具体任务
请按 azure-ai-voicelive-dotnet 为控制台项目给一个只处理用户文本消息并读取文本增量的会话代码草案,列出 endpoint、模型与身份前置条件。先不建立 WebSocket 连接。得到实时会话骨架;没有连接服务或收到音频/文本。
使用条件与边界
- 源文“晴天75°F”是硬编码天气占位结果,不是天气API,也不应部署为真实查询。
- NAudio 仅提供捕获/播放能力,安装它不会自动完成采样率转换、回声消除或音频路由。
- 源文模型名含 preview;上线前核对目标部署、区域、API版本和模型生命周期。
常见问题
为什么对方听不到声音?
分别检查输出音频增量是否收到、字节格式与设备采样率是否匹配,以及是否真实将PCM16数据写入播放设备。
function definition 会自动执行吗?
不会。它只声明工具接口;业务代码必须接收事件、校验参数、执行调用并回传结果。
来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
- 中文使用说明
- 已针对下方源文件版本整理用途、用法和常见问题
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料
.github/plugins/azure-sdk-dotnet/skills/azure-ai-voicelive-dotnet/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z
以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。
抓取成功不代表已完成安装或任务测试。
Azure AI Voice Live SDK for .NET. Build real-time voice AI applications with bidirectional WebSocket communication. Use for voice assistants, conversational AI, real-time speech-to-speech, and voice-enabled chatbots. Triggers: "voice live", "real-time voice", "VoiceLiveClient", "VoiceLiveSession", "voice assistant .NET", "bidirectional audio", "speech-to-speech".
查看源文件章节 / Source sections
- 原文:Azure.AI.VoiceLive (.NET)
- 安装 / Installation
- 原文:Environment Variables
- 原文:Authentication
- 原文:Microsoft Entra Token Credential
- 原文:API Key
- 原文:Client Hierarchy
- 原文:Core Workflow
- 原文:1. Start Session and Configure
- 原文:2. Process Events
- 原文:3. Send User Message
- 原文:4. Function Calling
- 原文:Voice Options
- 原文:Supported Models
- 原文:Key Types Reference
- 原文:Best Practices
- 原文:Error Handling
- 原文:Audio Configuration
- 原文:Related SDKs
- 原文:Reference Links
原文:Azure.AI.VoiceLive (.NET)
Real-time voice AI SDK for building bidirectional voice assistants with Azure AI.
安装 / Installation
```bash dotnet add package Azure.AI.VoiceLive dotnet add package Azure.Identity dotnet add package NAudio # For audio capture/playback ``` **Current Versions**: Stable v1.0.0, Preview v1.1.0-beta.1
原文:Environment Variables
```bash AZURE_VOICELIVE_ENDPOINT=https://<resource>.services.ai.azure.com/ # Required: Voice Live endpoint AZURE_VOICELIVE_MODEL=gpt-4o-realtime-preview # Required: model deployment name AZURE_VOICELIVE_VOICE=en-US-AvaNeural # Optional: Voice Live voice name AZURE_VOICELIVE_API_KEY=<your-api-key> # Only required for AzureKeyCredential auth AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production ```
原文:Microsoft Entra Token Credential
```csharp using Azure.Identity; using Azure.AI.VoiceLive; Uri endpoint = new Uri("https://your-resource.cognitiveservices.azure.com"); // Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential> var credential = new DefaultAzureCredential( DefaultAzureCredential.DefaultEnvironmentVariableName ); // Or use a specific credential directly in production: // See https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#credential-classes // var credential = new ManagedIdentityCredential(); VoiceLiveClient client = new VoiceLiveClient(endpoint, credential); ``` **Required Role**: `Cognitive Services User` (assign in Azure Portal → Access control)
原文:API Key
```csharp Uri endpoint = new Uri("https://your-resource.cognitiveservices.azure.com"); AzureKeyCredential credential = new AzureKeyCredential("your-api-key"); VoiceLiveClient client = new VoiceLiveClient(endpoint, credential); ```
原文:Client Hierarchy
``` VoiceLiveClient └── VoiceLiveSession (WebSocket connection) ├── ConfigureSessionAsync() ├── GetUpdatesAsync() → SessionUpdate events ├── AddItemAsync() → UserMessageItem, FunctionCallOutputItem ├── SendAudioAsync() └── StartResponseAsync() ```
文件 SHA256:3731d251910cb49587a0a83839e532fb1e70baa7750824d35b2a5e545c38da7a
仓库许可证记录:MIT;skill-declaration-captured-not-interpreted,查看来源。
Azure AI Voice Live SDK for .NET. Build real-time voice AI applications with bidirectional WebSocket communication. Use for voice assistants, conversational AI, real-time speech-to-speech, and voice-enabled chatbots. Triggers: "voice live", "real-time voice", "VoiceLiveClient", "VoiceLiveSession", "voice assistant .NET", "bidirectional audio", "speech-to-speech".
历史收录数据
| 来源仓库 | microsoft/skills |
|---|---|
| Skill源路径 | .github/plugins/azure-sdk-dotnet/skills/azure-ai-voicelive-dotnet/SKILL.md |
安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。
