{"id":"213183d5-4134-4c68-ae16-cdf9de454b9f","shortId":"yzxaFZ","kind":"skill","title":"azure-ai-voicelive-java","tagline":"Azure AI VoiceLive SDK for Java. Real-time bidirectional voice conversations with AI assistants using WebSocket.","description":"# Azure AI VoiceLive SDK for Java\n\nReal-time, bidirectional voice conversations with AI assistants using WebSocket technology.\n\n## Installation\n\n```xml\n<dependency>\n    <groupId>com.azure</groupId>\n    <artifactId>azure-ai-voicelive</artifactId>\n    <version>1.0.0-beta.2</version>\n</dependency>\n```\n\n## Environment Variables\n\n```bash\nAZURE_VOICELIVE_ENDPOINT=https://<resource>.openai.azure.com/\nAZURE_VOICELIVE_API_KEY=<your-api-key>\n```\n\n## Authentication\n\n### API Key\n\n```java\nimport com.azure.ai.voicelive.VoiceLiveAsyncClient;\nimport com.azure.ai.voicelive.VoiceLiveClientBuilder;\nimport com.azure.core.credential.AzureKeyCredential;\n\nVoiceLiveAsyncClient client = new VoiceLiveClientBuilder()\n    .endpoint(System.getenv(\"AZURE_VOICELIVE_ENDPOINT\"))\n    .credential(new AzureKeyCredential(System.getenv(\"AZURE_VOICELIVE_API_KEY\")))\n    .buildAsyncClient();\n```\n\n### DefaultAzureCredential (Recommended)\n\n```java\nimport com.azure.identity.DefaultAzureCredentialBuilder;\n\nVoiceLiveAsyncClient client = new VoiceLiveClientBuilder()\n    .endpoint(System.getenv(\"AZURE_VOICELIVE_ENDPOINT\"))\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .buildAsyncClient();\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| `VoiceLiveAsyncClient` | Main entry point for voice sessions |\n| `VoiceLiveSessionAsyncClient` | Active WebSocket connection for streaming |\n| `VoiceLiveSessionOptions` | Configuration for session behavior |\n\n### Audio Requirements\n\n- **Sample Rate**: 24kHz (24000 Hz)\n- **Bit Depth**: 16-bit PCM\n- **Channels**: Mono (1 channel)\n- **Format**: Signed PCM, little-endian\n\n## Core Workflow\n\n### 1. Start Session\n\n```java\nimport reactor.core.publisher.Mono;\n\nclient.startSession(\"gpt-4o-realtime-preview\")\n    .flatMap(session -> {\n        System.out.println(\"Session started\");\n        \n        // Subscribe to events\n        session.receiveEvents()\n            .subscribe(\n                event -> System.out.println(\"Event: \" + event.getType()),\n                error -> System.err.println(\"Error: \" + error.getMessage())\n            );\n        \n        return Mono.just(session);\n    })\n    .block();\n```\n\n### 2. Configure Session Options\n\n```java\nimport com.azure.ai.voicelive.models.*;\nimport java.util.Arrays;\n\nServerVadTurnDetection turnDetection = new ServerVadTurnDetection()\n    .setThreshold(0.5)                    // Sensitivity (0.0-1.0)\n    .setPrefixPaddingMs(300)              // Audio before speech\n    .setSilenceDurationMs(500)            // Silence to end turn\n    .setInterruptResponse(true)           // Allow interruptions\n    .setAutoTruncate(true)\n    .setCreateResponse(true);\n\nAudioInputTranscriptionOptions transcription = new AudioInputTranscriptionOptions(\n    AudioInputTranscriptionOptionsModel.WHISPER_1);\n\nVoiceLiveSessionOptions options = new VoiceLiveSessionOptions()\n    .setInstructions(\"You are a helpful AI voice assistant.\")\n    .setVoice(BinaryData.fromObject(new OpenAIVoice(OpenAIVoiceName.ALLOY)))\n    .setModalities(Arrays.asList(InteractionModality.TEXT, InteractionModality.AUDIO))\n    .setInputAudioFormat(InputAudioFormat.PCM16)\n    .setOutputAudioFormat(OutputAudioFormat.PCM16)\n    .setInputAudioSamplingRate(24000)\n    .setInputAudioNoiseReduction(new AudioNoiseReduction(AudioNoiseReductionType.NEAR_FIELD))\n    .setInputAudioEchoCancellation(new AudioEchoCancellation())\n    .setInputAudioTranscription(transcription)\n    .setTurnDetection(turnDetection);\n\n// Send configuration\nClientEventSessionUpdate updateEvent = new ClientEventSessionUpdate(options);\nsession.sendEvent(updateEvent).subscribe();\n```\n\n### 3. Send Audio Input\n\n```java\nbyte[] audioData = readAudioChunk(); // Your PCM16 audio data\nsession.sendInputAudio(BinaryData.fromBytes(audioData)).subscribe();\n```\n\n### 4. Handle Events\n\n```java\nsession.receiveEvents().subscribe(event -> {\n    ServerEventType eventType = event.getType();\n    \n    if (ServerEventType.SESSION_CREATED.equals(eventType)) {\n        System.out.println(\"Session created\");\n    } else if (ServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED.equals(eventType)) {\n        System.out.println(\"User started speaking\");\n    } else if (ServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED.equals(eventType)) {\n        System.out.println(\"User stopped speaking\");\n    } else if (ServerEventType.RESPONSE_AUDIO_DELTA.equals(eventType)) {\n        if (event instanceof SessionUpdateResponseAudioDelta) {\n            SessionUpdateResponseAudioDelta audioEvent = (SessionUpdateResponseAudioDelta) event;\n            playAudioChunk(audioEvent.getDelta());\n        }\n    } else if (ServerEventType.RESPONSE_DONE.equals(eventType)) {\n        System.out.println(\"Response complete\");\n    } else if (ServerEventType.ERROR.equals(eventType)) {\n        if (event instanceof SessionUpdateError) {\n            SessionUpdateError errorEvent = (SessionUpdateError) event;\n            System.err.println(\"Error: \" + errorEvent.getError().getMessage());\n        }\n    }\n});\n```\n\n## Voice Configuration\n\n### OpenAI Voices\n\n```java\n// Available: ALLOY, ASH, BALLAD, CORAL, ECHO, SAGE, SHIMMER, VERSE\nVoiceLiveSessionOptions options = new VoiceLiveSessionOptions()\n    .setVoice(BinaryData.fromObject(new OpenAIVoice(OpenAIVoiceName.ALLOY)));\n```\n\n### Azure Voices\n\n```java\n// Azure Standard Voice\noptions.setVoice(BinaryData.fromObject(new AzureStandardVoice(\"en-US-JennyNeural\")));\n\n// Azure Custom Voice\noptions.setVoice(BinaryData.fromObject(new AzureCustomVoice(\"myVoice\", \"endpointId\")));\n\n// Azure Personal Voice\noptions.setVoice(BinaryData.fromObject(\n    new AzurePersonalVoice(\"speakerProfileId\", PersonalVoiceModels.PHOENIX_LATEST_NEURAL)));\n```\n\n## Function Calling\n\n```java\nVoiceLiveFunctionDefinition weatherFunction = new VoiceLiveFunctionDefinition(\"get_weather\")\n    .setDescription(\"Get current weather for a location\")\n    .setParameters(BinaryData.fromObject(parametersSchema));\n\nVoiceLiveSessionOptions options = new VoiceLiveSessionOptions()\n    .setTools(Arrays.asList(weatherFunction))\n    .setInstructions(\"You have access to weather information.\");\n```\n\n## Best Practices\n\n1. **Use async client** — VoiceLive requires reactive patterns\n2. **Configure turn detection** for natural conversation flow\n3. **Enable noise reduction** for better speech recognition\n4. **Handle interruptions** gracefully with `setInterruptResponse(true)`\n5. **Use Whisper transcription** for input audio transcription\n6. **Close sessions** properly when conversation ends\n\n## Error Handling\n\n```java\nsession.receiveEvents()\n    .doOnError(error -> System.err.println(\"Connection error: \" + error.getMessage()))\n    .onErrorResume(error -> {\n        // Attempt reconnection or cleanup\n        return Flux.empty();\n    })\n    .subscribe();\n```\n\n## Reference Links\n\n| Resource | URL |\n|----------|-----|\n| GitHub Source | https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-voicelive |\n| Samples | https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-voicelive/src/samples |\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","java","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding"],"capabilities":["skill","source-sickn33","skill-azure-ai-voicelive-java","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-java","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 (7,444 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.958Z","embedding":null,"createdAt":"2026-04-18T21:32:07.156Z","updatedAt":"2026-04-24T18:50:28.958Z","lastSeenAt":"2026-04-24T18:50:28.958Z","tsv":"'-1.0':205 '/azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-voicelive':530 '/azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-voicelive/src/samples':534 '0.0':204 '0.5':202 '1':144,154,230,457 '1.0.0':48 '16':139 '2':188,465 '24000':135,257 '24khz':134 '3':280,473 '300':207 '4':296,481 '4o':163 '5':488 '500':212 '6':496 'access':451 'action':547 'activ':120 'ai':3,7,19,24,36,46,240 'allow':219 'alloy':371 'api':59,62,86 'applic':541 'arrays.aslist':249,446 'ash':372 'ask':585 'assist':20,37,242 'async':459 'attempt':515 'audio':130,208,282,290,494 'audiodata':286,294 'audioechocancel':265 'audioev':337 'audioevent.getdelta':341 'audioinputtranscriptionopt':225,228 'audioinputtranscriptionoptionsmodel.whisper':229 'audionoisereduct':260 'audionoisereductiontype.near':261 'authent':61 'avail':370 'azur':2,6,23,45,53,57,77,84,100,388,391,402,411 'azure-ai-voicel':44 'azure-ai-voicelive-java':1 'azurecustomvoic':408 'azurekeycredenti':82 'azurepersonalvoic':417 'azurestandardvoic':397 'ballad':373 'bash':52 'behavior':129 'best':455 'beta.2':49 'better':478 'bidirect':15,32 'binarydata.frombytes':293 'binarydata.fromobject':244,384,395,406,415,439 'bit':137,140 'block':187 'boundari':593 'build':106 'buildasynccli':88,107 'byte':285 'call':423 'channel':142,145 'clarif':587 'cleanup':518 'clear':560 'client':72,95,460 'client.startsession':160 'clienteventsessionupd':272,275 'close':497 'com.azure':43 'com.azure.ai.voicelive.models':194 'com.azure.ai.voicelive.voiceliveasyncclient':66 'com.azure.ai.voicelive.voiceliveclientbuilder':68 'com.azure.core.credential.azurekeycredential':70 'com.azure.identity.defaultazurecredentialbuilder':93 'complet':348 'concept':109,110 'configur':126,189,271,366,466 'connect':122,510 'convers':17,34,471,501 'coral':374 'core':152 'creat':311 'credenti':80,103 'criteria':596 'current':433 'custom':403 'data':291 'defaultazurecredenti':89 'defaultazurecredentialbuild':105 'depth':138 'describ':548,564 'descript':111 'detect':468 'doonerror':507 'echo':375 'els':312,320,328,342,349 'en':399 'en-us-jennyneur':398 'enabl':474 'end':215,502 'endian':151 'endpoint':55,75,79,98,102 'endpointid':410 'entri':114 'environ':50,576 'environment-specif':575 'error':180,182,362,503,508,511,514 'error.getmessage':183,512 'errorev':358 'errorevent.geterror':363 'event':173,176,178,298,302,333,339,354,360 'event.gettype':179,305 'eventtyp':304,308,315,323,331,345,352 'execut':543 'expert':581 'field':262 'flatmap':166 'flow':472 'flux.empty':520 'format':146 'function':422 'get':429,432 'getmessag':364 'github':526 'github.com':529,533 'github.com/azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-voicelive':528 'github.com/azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-voicelive/src/samples':532 'gpt':162 'gpt-4o-realtime-preview':161 'grace':484 'handl':297,482,504 'help':239 'hz':136 'import':65,67,69,92,158,193,195 'inform':454 'input':283,493,590 'inputaudioformat.pcm16':253 'instal':41 'instanceof':334,355 'interactionmodality.audio':251 'interactionmodality.text':250 'interrupt':220,483 'java':5,11,28,64,91,157,192,284,299,369,390,424,505 'java.util.arrays':196 'jennyneur':401 'key':60,63,87,108 'latest':420 'limit':552 'link':523 'littl':150 'little-endian':149 'locat':437 'main':113 'match':561 'miss':598 'mono':143 'mono.just':185 'myvoic':409 'natur':470 'neural':421 'new':73,81,96,104,199,227,233,245,259,264,274,381,385,396,407,416,427,443 'nois':475 'onerrorresum':513 'openai':367 'openai.azure.com':56 'openaivoic':246,386 'openaivoicename.alloy':247,387 'option':191,232,276,380,442 'options.setvoice':394,405,414 'output':570 'outputaudioformat.pcm16':255 'overview':551 'parametersschema':440 'pattern':464 'pcm':141,148 'pcm16':289 'permiss':591 'person':412 'personalvoicemodels.phoenix':419 'playaudiochunk':340 'point':115 'practic':456 'preview':165 'proper':499 'rate':133 'reactiv':463 'reactor.core.publisher.mono':159 'readaudiochunk':287 'real':13,30 'real-tim':12,29 'realtim':164 'recognit':480 'recommend':90 'reconnect':516 'reduct':476 'refer':522 'requir':131,462,589 'resourc':524 'respons':347 'return':184,519 'review':582 'safeti':592 'sage':376 'sampl':132,531 'scope':563 'sdk':9,26 'send':270,281 'sensit':203 'servereventtyp':303 'servereventtype.error.equals':351 'servereventtype.input_audio_buffer_speech_started.equals':314 'servereventtype.input_audio_buffer_speech_stopped.equals':322 'servereventtype.response_audio_delta.equals':330 'servereventtype.response_done.equals':344 'servereventtype.session_created.equals':307 'servervadturndetect':197,200 'session':118,128,156,167,169,186,190,310,498 'session.receiveevents':174,300,506 'session.sendevent':277 'session.sendinputaudio':292 'sessionupdateerror':356,357,359 'sessionupdateresponseaudiodelta':335,336,338 'setautotrunc':221 'setcreaterespons':223 'setdescript':431 'setinputaudioechocancel':263 'setinputaudioformat':252 'setinputaudionoisereduct':258 'setinputaudiosamplingr':256 'setinputaudiotranscript':266 'setinstruct':235,448 'setinterruptrespons':217,486 'setmod':248 'setoutputaudioformat':254 'setparamet':438 'setprefixpaddingm':206 'setsilencedurationm':211 'setthreshold':201 'settool':445 'setturndetect':268 'setvoic':243,383 'shimmer':377 'sign':147 'silenc':213 'skill':539,555 'skill-azure-ai-voicelive-java' 'sourc':527 'source-sickn33' 'speak':319,327 'speakerprofileid':418 'specif':577 'speech':210,479 'standard':392 'start':155,170,318 'stop':326,583 'stream':124 'subscrib':171,175,279,295,301,521 'substitut':573 'success':595 'system.err.println':181,361,509 'system.getenv':76,83,99 'system.out.println':168,177,309,316,324,346 'task':559 'technolog':40 'test':579 'time':14,31 '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' 'transcript':226,267,491,495 'treat':568 'true':218,222,224,487 'turn':216,467 'turndetect':198,269 'updateev':273,278 'url':525 'us':400 'use':21,38,458,489,537,553 'user':317,325 'valid':578 'variabl':51 'vers':378 'voic':16,33,117,241,365,368,389,393,404,413 'voicel':4,8,25,47,54,58,78,85,101,461 'voiceliveasynccli':71,94,112 'voiceliveclientbuild':74,97 'voicelivefunctiondefinit':425,428 'voicelivesessionasynccli':119 'voicelivesessionopt':125,231,234,379,382,441,444 'weather':430,434,453 'weatherfunct':426,447 'websocket':22,39,121 'whisper':490 'workflow':153,545 'xml':42","prices":[{"id":"ad37af56-e3ae-4193-b9fc-da048efae032","listingId":"213183d5-4134-4c68-ae16-cdf9de454b9f","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:07.156Z"}],"sources":[{"listingId":"213183d5-4134-4c68-ae16-cdf9de454b9f","source":"github","sourceId":"sickn33/antigravity-awesome-skills/azure-ai-voicelive-java","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-ai-voicelive-java","isPrimary":false,"firstSeenAt":"2026-04-18T21:32:07.156Z","lastSeenAt":"2026-04-24T18:50:28.958Z"}],"details":{"listingId":"213183d5-4134-4c68-ae16-cdf9de454b9f","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"azure-ai-voicelive-java","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":"90792086c66be147cb607dec711170ef591140de","skill_md_path":"skills/azure-ai-voicelive-java/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-ai-voicelive-java"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"azure-ai-voicelive-java","description":"Azure AI VoiceLive SDK for Java. Real-time bidirectional voice conversations with AI assistants using WebSocket."},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/azure-ai-voicelive-java"},"updatedAt":"2026-04-24T18:50:28.958Z"}}