Pular para o conteúdo
Skillpedia
Agentes15 mil · #10952

add-voice

O que ela faz

Permite que o assistente adicione uma conversa de voz ao vivo a um app existente, com o microfone enviando a fala e as respostas em áudio voltando. É para desenvolvedores que criam assistentes de voz.

Quando usar

  • ✓Quando você quer que os usuários conversem com uma IA em tempo real por voz.
  • ✓Quando seu app encadeia etapas separadas de fala em texto, modelo de linguagem e texto em fala que poderiam virar um único ciclo de voz.
  • ✓Quando você quer um botão de modo de voz no app com autenticação segura.

Link da skill

https://github.com/cursor/plugins/blob/main/grok-voice/skills/add-voice/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/cursor/plugins/blob/main/grok-voice/skills/add-voice/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Adicione um modo de voz ao nosso app para que os usuários possam conversar com o assistente e ouvi-lo responder em tempo real.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O assistente mapeia seu app, configura um acesso seguro pelo seu servidor ou por um token temporário, e conecta o microfone a uma conexão de voz em tempo real que envia e recebe áudio.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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

Steps

  1. 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/stt or /v1/tts only if the product still needs one-shot listen or speak outside the agent.
  2. Auth

    • Server: Bearer XAI_API_KEY.
    • Browser/mobile: backend POST https://api.x.ai/v1/realtime/client_secrets, client uses ephemeral token (Bearer or browser sec-websocket-protocol: xai-client-secret.<token>).
    • Never put a long-lived key in client bundles. Do not paste keys in chat.
  3. Connect + session

    • URL: wss://api.x.ai/v1/realtime?model=grok-voice-latest
    • On open: session.update with voice (default eve), instructions, turn_detection: { type: "server_vad" } (or null for 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.updated is cumulative, not a delta).
    • Tools if needed: web_search, x_search, file_search, mcp, custom function.
  4. Audio I/O (app-side)

    • One AudioContext per 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.delta immediately; schedule with a ~150 ms lead so chunks butt together. On input_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 from response.output_audio_transcript.delta / .done, close the turn on response.done.
    • On function tools: function_call_output, finish playback, then response.create.
  5. Composer UI convention

    • One primary button, right side of the composer. Empty composer → waveform icon (stroked, e.g. Phosphor WaveformIcon weight="bold"; never the fill weight, 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 an sr-only role="status". No separate status row.
    • The microphone icon is reserved for dictation (/add-dictation). Never use it for voice mode.
  6. 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.",
     
Perguntas frequentes

A chave de API fica protegida?

Sim. Apps de navegador e mobile usam um token temporário do seu backend, e não a chave principal.

Ele substitui uma configuração antiga?

Se seu app usa uma cadeia separada de fala em texto, modelo de linguagem e fala, a skill pode substituí-la por um único ciclo de voz.

Onde o microfone é tratado?

No seu app, já que a própria ferramenta de código não tem microfone.

Detalhes

Descrição original do autor

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

Popularidade

Estrelas no GitHub
15 mil
Posição no ranking
#10952
Licença
—
Atualizada em
31/10/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas