Skip to main content 홈 크리에이터 ranbot-ai awesome-skills azure-ai-voicelive-ts
azure-ai-voicelive-ts Azure AI Voice Live SDK for JavaScript/TypeScript. Build real-time voice AI applications with bidirectional WebSocket communication.
설치로 이동 Skills Marketplace 커뮤니티가 만든 AI 스킬을 발견하고 탐색하세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/ranbot-ai/awesome-skills --skill azure-ai-voicelive-ts명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Zip 다운로드 다운로드 중... name azure-ai-voicelive-ts description Azure AI Voice Live SDK for JavaScript/TypeScript. Build real-time voice AI applications with bidirectional WebSocket communication. category AI & Agents source antigravity tags ["javascript","typescript","node","api","ai","gpt","workflow","azure","cro"] url https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-ai-voicelive-ts
@azure/ai-voicelive (JavaScript/TypeScript)
Real-time voice AI SDK for building bidirectional voice assistants with Azure AI in Node.js and browser environments.
Installation
npm install @azure/ai-voicelive @azure/identity
npm install @types/node
Current Version : 1.0.0-beta.3
Supported Environments :
Node.js LTS versions (20+)
Modern browsers (Chrome, Firefox, Safari, Edge)
Environment Variables
AZURE_VOICELIVE_ENDPOINT=https://<resource>.cognitiveservices.azure.com
AZURE_VOICELIVE_API_KEY=<your-api-key>
AZURE_LOG_LEVEL=info
Authentication
Microsoft Entra ID (Recommended) import { DefaultAzureCredential } from "@azure/identity" ;
import { VoiceLiveClient } from "@azure/ai-voicelive" ;
const credential = new DefaultAzureCredential ();
const endpoint = "https://your-resource.cognitiveservices.azure.com" ;
const client = new VoiceLiveClient (endpoint, credential);
API Key import { AzureKeyCredential } from "@azure/core-auth" ;
import { VoiceLiveClient } from "@azure/ai-voicelive" ;
const endpoint = "https://your-resource.cognitiveservices.azure.com" ;
const credential = new AzureKeyCredential ("your-api-key" );
const client = new VoiceLiveClient (endpoint, credential);
Client Hierarchy VoiceLiveClient
└── VoiceLiveSession (WebSocket connection)
├── updateSession() → Configure session options
├── subscribe() → Event handlers (Azure SDK pattern)
├── sendAudio() → Stream audio input
├── addConversationItem() → Add messages/function outputs
└── sendEvent() → Send raw protocol events
Quick Start import { DefaultAzureCredential } from "@azure/identity" ;
import { VoiceLiveClient } from "@azure/ai-voicelive" ;
const credential = new DefaultAzureCredential ();
const endpoint = process.env .AZURE_VOICELIVE_ENDPOINT !;
const client = new VoiceLiveClient (endpoint, credential);
const session = await client.startSession ("gpt-4o-mini-realtime-preview" );
await session.updateSession ({
modalities : ["text" , "audio" ],
instructions : "You are a helpful AI assistant. Respond naturally." ,
voice : {
type : "azure-standard" ,
name : "en-US-AvaNeural" ,
},
turnDetection : {
type : "server_vad" ,
threshold : 0.5 ,
prefixPaddingMs : 300 ,
silenceDurationMs : 500 ,
},
inputAudioFormat : "pcm16" ,
outputAudioFormat : "pcm16" ,
});
const subscription = session.subscribe ({
onResponseAudioDelta : async (event, context) => {
const audioData = event.delta ;
playAudioChunk (audioData);
},
onResponseTextDelta : async (event, context) => {
process.stdout .write (event.delta );
},
onInputAudioTranscriptionCompleted : async (event, context) => {
console .log ("User said:" , event.transcript );
},
});
function sendAudioChunk (audioBuffer : ArrayBuffer ) {
session.sendAudio (audioBuffer);
}
Session Configuration await session.updateSession ({
modalities : ["audio" , "text" ],
instructions : "You are a customer service representative." ,
voice : {
type : "azure-standard" ,
name : "en-US-AvaNeural" ,
},
turnDetection : {
type : "server_vad" ,
threshold : 0.5 ,
prefixPaddingMs : 300 ,
silenceDurationMs : 500 ,
},
inputAudioFormat : "pcm16" ,
outputAudioFormat : "pcm16" ,
tools : [
{
type : "function" ,
name : "get_weather" ,
description : "Get current weather" ,
parameters : {
type : "object" ,
properties : {
location : { type : "string" }
},
required : ["location" ]
}
}
],
toolChoice : "auto" ,
});
Event Handling (Azure SDK Pattern) The SDK uses a subscription-based event handling pattern:
const subscription = session.subscribe ({
onConnected : async (args, context) => {
console .log ("Connected:" , args.connectionId );
},
onDisconnected : async (args, context) => {
console .log ("Disconnected:" , args.code , args.reason );
},
onError : async (args, context) => {
console .error ("Error:" , args.error .message );
},
onSessionCreated : async (event, context) => {
console .log ("Session created:" , context.sessionId );
},
onSessionUpdated : async (event, context) => {
console .log ("Session updated" );
},
onInputAudioBufferSpeechStarted : async (event, context) => {
console .log ("Speech started at:" , event.audioStartMs );
},
onInputAudioBufferSpeechSto