add-voice
यह क्या करती है
यह स्किल असिस्टेंट को मौजूदा ऐप में लाइव वॉइस बातचीत जोड़ने देती है, जहाँ माइक्रोफ़ोन बोली भेजता है और ऑडियो जवाब वापस आते हैं। यह वॉइस असिस्टेंट बनाने वाले डेवलपर्स के लिए है।
कब इस्तेमाल करें
- ✓जब आप चाहते हैं कि यूज़र रियल टाइम में आवाज़ से AI से बात करें।
- ✓जब आपके ऐप में अलग-अलग speech-to-text, भाषा मॉडल और text-to-speech चरण जुड़े हैं जो एक वॉइस लूप बन सकते हैं।
- ✓जब आप सुरक्षित प्रमाणीकरण के साथ ऐप में वॉइस मोड बटन चाहते हैं।
Skill का लिंक
https://github.com/cursor/plugins/blob/main/grok-voice/skills/add-voice/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“हमारे ऐप में वॉइस मोड जोड़िए, ताकि यूज़र असिस्टेंट से बात करें और रियल टाइम में उसका जवाब सुनें।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
असिस्टेंट आपके ऐप को मैप करता है, आपके सर्वर या एक अस्थायी टोकन के ज़रिए सुरक्षित पहुँच सेट करता है, और माइक्रोफ़ोन को एक रियलटाइम वॉइस कनेक्शन से जोड़ता है जो ऑडियो अंदर और बाहर भेजता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Add Voice
Add Grok Speech to Speech to an existing app. Run on /add-voice, typed Voice Mode, or clear “add Grok voice” intent.
Goal
Working duplex path: user-app mic in, audio out, wss://api.x.ai/v1/realtime?model=grok-voice-latest, safe auth. Cursor has no native mic; wire the app (or a sample client), not the IDE.
Protocol first
Language-agnostic event loop. TypeScript samples default. Short Python twins only where the client API differs (e.g. ws vs websockets).
Docs
- https://docs.x.ai/developers/model-capabilities/audio/speech-to-speech
- https://docs.x.ai/developers/model-capabilities/audio/ephemeral-tokens
- Pricing (cite docs only): https://docs.x.ai/developers/pricing (~$0.08/min STS + $0.004/text item; max session 120 min)
Steps
Map the app
- Stack: none, OpenAI Realtime, STT→LLM→TTS cascade, TTS/STT only.
- Client: web / Node / iOS / Android / server.
- If a cascade or OpenAI Realtime exists: replace it with the single duplex loop below (URL, model, voice, event diffs); keep standalone
/v1/sttor/v1/ttsonly if the product still needs one-shot listen or speak outside the agent.
Auth
- Server: Bearer
XAI_API_KEY. - Browser/mobile: backend
POST https://api.x.ai/v1/realtime/client_secrets, client uses ephemeral token (Bearer or browsersec-websocket-protocol:xai-client-secret.<token>). - Never put a long-lived key in client bundles. Do not paste keys in chat.
- Server: Bearer
Connect + session
- URL:
wss://api.x.ai/v1/realtime?model=grok-voice-latest - On open:
session.updatewithvoice(defaulteve),instructions,turn_detection: { type: "server_vad" }(ornullfor push-to-talk), PCM 24 kHz unless the app already standardizes elsewhere. - Set
audio.input.transcription.model: "grok-transcribe"or no user transcript arrives (conversation.item.input_audio_transcription.updatedis cumulative, not a delta). - Tools if needed:
web_search,x_search,file_search,mcp, customfunction.
- URL:
Audio I/O (app-side)
- One
AudioContextper session for capture and playback, created inside the user gesture (autoplay policy). Ask for 24 kHz; if the browser gives another rate, resample before sending. - Mic → AudioWorklet in ~100 ms chunks →
input_audio_buffer.append(or binary transport). Start WS and mic in parallel; buffer early audio, flush on open. - Play
response.output_audio.deltaimmediately; schedule with a ~150 ms lead so chunks butt together. Oninput_audio_buffer.speech_started, stop everything queued (barge-in). - Transcript rows: create the user row on
input_audio_buffer.committed(item_id), fill it on…transcription.updated; assistant text fromresponse.output_audio_transcript.delta/.done, close the turn onresponse.done. - On function tools:
function_call_output, finish playback, thenresponse.create.
- One
Composer UI convention
- One primary button, right side of the composer. Empty composer → waveform icon (stroked, e.g. Phosphor
WaveformIcon weight="bold"; never thefillweight, which renders as a blob at 16 px), starts voice mode. Any text present → classic send arrow; in voice mode that text goes into the live session (conversation.item.create+response.create). Text reply streaming → stop square. - While voice is live the same button shows an animated waveform (4 bars, ~3 px wide, 2 px gap, ~16 px tall, min scale 0.4 so they stay legible in a 28 px button) and ends the session on click. Phase drives the animation: listening slow, speaking fast, connecting/thinking slower and slightly dimmed (opacity ≥ 0.75). Honor
prefers-reduced-motion. No X button, no pulsing ring. - Status lives in the composer, not around it: the placeholder reads
Connecting…/Listening…/Thinking…/Speaking…, plus ansr-onlyrole="status". No separate status row. - The microphone icon is reserved for dictation (
/add-dictation). Never use it for voice mode.
- One primary button, right side of the composer. Empty composer → waveform icon (stroked, e.g. Phosphor
TS skeleton (default)
const url = "wss://api.x.ai/v1/realtime?model=grok-voice-latest";
// Node: pass Authorization header. Browser: use xai-client-secret.<token> protocol.
const ws = new WebSocket(url /* , { headers: { Authorization: `Bearer ${token}` } } */);
ws.addEventListener("open", () => {
ws.send(JSON.stringify({
type: "session.update",
session: {
voice: "eve",
instructions: "You are a helpful voice agent.",
अक्सर पूछे जाने वाले सवाल
क्या API कुंजी सुरक्षित रहती है?
हाँ। ब्राउज़र और मोबाइल ऐप मुख्य कुंजी की जगह आपके बैकएंड से लिया अस्थायी टोकन इस्तेमाल करते हैं।
क्या यह पुराने सेटअप की जगह लेता है?
अगर आपका ऐप अलग speech-to-text, भाषा मॉडल और speech चेन इस्तेमाल करता है, तो स्किल उसे एक वॉइस लूप से बदल सकती है।
माइक्रोफ़ोन कहाँ संभाला जाता है?
आपके ऐप में, क्योंकि कोडिंग टूल का अपना कोई माइक्रोफ़ोन नहीं होता।
जानकारी
लेखक का मूल विवरण
Use when the user runs /add-voice, types Voice Mode, or asks to add Grok realtime voice to an app, including replacing an STT-LLM-TTS cascade or OpenAI Realtime. Wire speech-to-speech, safe auth, and app mic. Composer: waveform button, mic icon reserved for dictation. For mic-to-text only use /add-dictation; to speak text replies use /add-read-aloud. To add debug logging and fix from logs use /debug-voice.
repo: cursor/plugins
लोकप्रियता
- GitHub स्टार
- 15k
- रैंकिंग में स्थान
- #10952
- लाइसेंस
- —
- अपडेट की गई
- 31/10/2026
कमेंट
- …
इस repository की और skills
advisor
15kअगर आप इसे चालू करते हैं, तो आपका एजेंट बड़े फ़ैसले से पहले या किसी त्रुटि में अटकने पर एक ज़्यादा शक्तिशाली दूसरे मॉडल से सलाह ले सकता है।
check-agent-compatibility
15kजाँचती है कि AI कोडिंग एजेंट किसी रिपॉज़िटरी को शुरू, सत्यापित और दस्तावेज़ित कर सकते हैं या नहीं, और एक अनुकूलता स्कोर के साथ मुख्य समस्याएँ लौटाती है।
cli-for-agents
15kआपके एजेंट को कमांड-लाइन टूल ऐसे डिज़ाइन या जाँचना सिखाती है कि AI एजेंट उन्हें बिना प्रॉम्प्ट चला सकें, साफ़ help टेक्स्ट और उदाहरणों के साथ।
continual-learning
15kपिछली चैट की समीक्षा का काम एक समर्पित मेमोरी अपडेटर को सौंपकर आपकी AGENTS.md नोट्स को अद्यतन रखती है।
मिलती-जुलती skills
add-model-provider
394kयह आपके एजेंट को सुरक्षित कमांड से OpenClaw में नया AI मॉडल प्रोवाइडर जोड़ने, API कीज़ को सादे टेक्स्ट से बचाने और लाइव टेस्ट चलाने देती है।
acp-router
394kयह आपके एजेंट को OpenClaw के ज़रिए Claude Code या Cursor जैसे कोडिंग असिस्टेंट को काम भेजने देती है, ताकि काम उसी टूल में चले।
browser-automation
394kयह आपके एजेंट को लॉगिन, टैब और अटकी वेब पेज से उबरने समेत, वेबसाइट पर चरण-दर-चरण काम करना सिखाती है।