# Speech To Text > Transcribe audio a texto con ElevenLabs Scribe v2. Úsalo para convertir audio o vídeo a texto, generar subtítulos, transcribir reuniones o procesar contenido hablado. Fuente: https://skillsagentes.com/skills/calesthio/openmontage/speech-to-text Markdown: https://skillsagentes.com/skills/calesthio/openmontage/speech-to-text.md Repositorio: https://github.com/calesthio/OpenMontage Autor: calesthio Licencia: MIT Actualizado: hace 4 meses Coste de contexto: 42 tok instalada, 2k tok al activarse, 10.3k tok con todos los archivos del bundle Bundle: 7 archivos, 40 KB Permisos que pide: ninguno declarado ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add calesthio/OpenMontage --skill speech-to-text --agent claude-code # Cursor npx -y skills add calesthio/OpenMontage --skill speech-to-text --agent cursor # Codex npx -y skills add calesthio/OpenMontage --skill speech-to-text --agent codex # Gemini CLI npx -y skills add calesthio/OpenMontage --skill speech-to-text --agent gemini # Windsurf npx -y skills add calesthio/OpenMontage --skill speech-to-text --agent windsurf # Cline npx -y skills add calesthio/OpenMontage --skill speech-to-text --agent cline ``` ## Qué hace - Transcribe audio a texto con ElevenLabs Scribe v2 - Devuelve marcas de tiempo y admite diarización de hablantes - Permite keyterm prompting y detección de idioma - Documenta formatos soportados, formato de respuesta, manejo de errores y seguimiento de costes - Cubre streaming en tiempo real con estrategias de commit y tipos de evento ## Cuándo usarla - Convertir audio o vídeo a texto - Generar subtítulos - Transcribir reuniones o procesar contenido hablado ## Qué la activa - "Transcribe esta reunión" - "Genera subtítulos con marcas de tiempo" - "Separa lo que dice cada hablante en este audio" ## Antes de instalar - Necesita acceso a internet y una `ELEVENLABS_API_KEY`. - Necesita en el PATH: curl - Variables de entorno: ELEVENLABS_API_KEY - makes network requests - needs API credentials ## Archivos - SKILL.md — 8 KB - references/installation.md — 2 KB - references/realtime-client-side.md — 5 KB - references/realtime-commit-strategies.md — 4 KB - references/realtime-events.md — 5 KB - references/realtime-server-side.md — 8 KB - references/transcription-options.md — 7 KB ## SKILL.md Reproducido tal cual desde calesthio/OpenMontage bajo MIT. Esta sección es el documento original y está en inglés. # ElevenLabs Speech-to-Text Transcribe audio to text with Scribe v2 - supports 90+ languages, speaker diarization, and word-level timestamps. > **Setup:** See [Installation Guide](references/installation.md). For JavaScript, use `@elevenlabs/*` packages only. ## Quick Start ### Python ```python from elevenlabs import ElevenLabs client = ElevenLabs() with open("audio.mp3", "rb") as audio_file: result = client.speech_to_text.convert(file=audio_file, model_id="scribe_v2") print(result.text) ``` ### JavaScript ```javascript import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js"; import { createReadStream } from "fs"; const client = new ElevenLabsClient(); const result = await client.speechToText.convert({ file: createReadStream("audio.mp3"), modelId: "scribe_v2", }); console.log(result.text); ``` ### cURL ```bash curl -X POST "https://api.elevenlabs.io/v1/speech-to-text" \ -H "xi-api-key: $ELEVENLABS_API_KEY" -F "file=@audio.mp3" -F "model_id=scribe_v2" ``` ## Models | Model ID | Description | Best For | |----------|-------------|----------| | `scribe_v2` | State-of-the-art accuracy, 90+ languages | Batch transcription, subtitles, long-form audio | | `scribe_v2_realtime` | Low latency (~150ms) | Live transcription, voice agents | ## Transcription with Timestamps Word-level timestamps include type classification and speaker identification: ```python result = client.speech_to_text.convert( file=audio_file, model_id="scribe_v2", timestamps_granularity="word" ) for word in result.words: print(f"{word.text}: {word.start}s - {word.end}s (type: {word.type})") ``` ## Speaker Diarization Identify WHO said WHAT - the model labels each word with a speaker ID, useful for meetings, interviews, or any multi-speaker audio: ```python result = client.speech_to_text.convert( file=audio_file, model_id="scribe_v2", diarize=True ) for word in result.words: print(f"[{word.speaker_id}] {word.text}") ``` ## Keyterm Prompting Help the model recognize specific words it might otherwise mishear - product names, technical jargon, or unusual spellings (up to 100 terms): ```python result = client.speech_to_text.convert( file=audio_file, model_id="scribe_v2", keyterms=["ElevenLabs", "Scribe", "API"] ) ``` ## Language Detection Automatic detection with optional language hint: ```python result = client.speech_to_text.convert( file=audio_file, model_id="scribe_v2", language_code="eng" # ISO 639-1 or ISO 639-3 code ) print(f"Detected: {result.language_code} ({result.language_probability:.0%})") ``` ## Supported Formats **Audio:** MP3, WAV, M4A, FLAC, OGG, WebM, AAC, AIFF, Opus **Video:** MP4, AVI, MKV, MOV, WMV, FLV, WebM, MPEG, 3GPP **Limits:** Up to 3GB file size, 10 hours duration ## Response Format ```json { "text": "The full transcription text", "language_code": "eng", "language_probability": 0.98, "words": [ {"text": "The", "start": 0.0, "end": 0.15, "type": "word", "speaker_id": "speaker_0"}, {"text": " ", "start": 0.15, "end": 0.16, "type": "spacing", "speaker_id": "speaker_0"} ] } ``` **Word types:** - `word` - An actual spoken word - `spacing` - Whitespace between words (useful for precise timing) - `audio_event` - Non-speech sounds the model detected (laughter, applause, music, etc.) ## Error Handling ```python try: result = client.speech_to_text.convert(file=audio_file, model_id="scribe_v2") except Exception as e: print(f"Transcription failed: {e}") ``` Common errors: - **401**: Invalid API key - **422**: Invalid parameters - **429**: Rate limit exceeded ## Tracking Costs Monitor usage via `request-id` response header: ```python response = client.speech_to_text.convert.with_raw_response(file=audio_file, model_id="scribe_v2") result = response.parse() print(f"Request ID: {response.headers.get('request-id')}") ``` ## Real-Time Streaming For live transcription with ultra-low latency (~150ms), use the real-time API. The real-time API produces two types of transcripts: - **Partial transcripts**: Interim results that update frequently as audio is processed - use these for live feedback (e.g., showing text as the user speaks) - **Committed transcripts**: Final, stable results after you "commit" - use these as the source of truth for your application A "commit" tells the model to finalize the current segment. You can commit manually (e.g., when the user pauses) or use Voice Activity Detection (VAD) to auto-commit on silence. ### Python (Server-Side) ```python import asyncio from elevenlabs import ElevenLabs client = ElevenLabs() async def transcribe_realtime(): async with client.speech_to_text.realtime.connect( model_id="scribe_v2_realtime", include_timestamps=True, ) as connection: await connection.stream_url("https://example.com/audio.mp3") async for event in connection: if event.type == "partial_transcript": print(f"Partial: {event.text}") elif event.type == "committed_transcript": print(f"Final: {event.text}") asyncio.run(transcribe_realtime()) ``` ### JavaScript (Client-Side with React) ```typescript import { useScribe, CommitStrategy } from "@elevenlabs/react"; function TranscriptionComponent() { const [transcript, setTranscript] = useState(""); const scribe = useScribe({ modelId: "scribe_v2_realtime", commitStrategy: CommitStrategy.VAD, // Auto-commit on silence for mic input onPartialTranscript: (data) => console.log("Partial:", data.text), onCommittedTranscript: (data) => setTranscript((prev) => prev + data.text), }); const start = async () => { // Get token from your backend (never expose API key to client) const { token } = await fetch("/scribe-token").then((r) => r.json()); await scribe.connect({ token, microphone: { echoCancellation: true, noiseSuppression: true }, }); }; return ; } ``` ### Commit Strategies | Strategy | Description | |----------|-------------| | **Manual** | You call `commit()` when ready - use for file processing or when you control the audio segments | | **VAD** | Voice Activity Detection auto-commits when silence is detected - use for live microphone input | ```typescript // React: set commitStrategy on the hook (recommended for mic input) import { useScribe, CommitStrategy } from "@elevenlabs/react"; const scribe = useScribe({ modelId: "scribe_v2_realtime", commitStrategy: CommitStrategy.VAD, // Optional VAD tuning: vadSilenceThresholdSecs: 1.5, vadThreshold: 0.4, }); ``` ```javascript // JavaScript client: pass vad config on connect const connection = await client.speechToText.realtime.connect({ modelId: "scribe_v2_realtime", vad: { silenceThresholdSecs: 1.5, threshold: 0.4, }, }); ``` ### Event Types | Event | Description | |-------|-------------| | `partial_transcript` | Live interim results | | `committed_transcript` | Final results after commit | | `committed_transcript_with_timestamps` | Final with word timing | | `error` | Error occurred | See real-time references for complete documentation. ## References - [Installation Guide](references/installation.md) - [Transcription Options](references/transcription-options.md) - [Real-Time Client-Side Streaming](references/realtime-client-side.md) - [Real-Time Server-Side Streaming](references/realtime-server-side.md) - [Commit Strategies](references/realtime-commit-strategies.md) - [Real-Time Event Reference](references/realtime-events.md) ## Dónde encaja - Categoría: [Datos y analítica](https://skillsagentes.com/categorias/datos-analitica.md) — Consulta, limpia y visualiza datos sin salir del agente. - Creador: [calesthio](https://skillsagentes.com/creators/calesthio.md) — 0 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Seedance 2 5](https://skillsagentes.com/skills/calesthio/openmontage/seedance-2-5.md): Genera vídeo cinematográfico de 4-30 s con ByteDance Seedance 2.5 por fal.ai, Volcengine Ark, Runway o ComfyUI. Cubre el contrato de prompt 2.5, cortes duros, locks de continuidad y voz. - [Comfyui](https://skillsagentes.com/skills/calesthio/openmontage/comfyui.md): Úsalo al trabajar con workflows de ComfyUI en OpenMontage: comfyui_image/video/music, workflows propios, selección de output_node, modelos que faltan, LoRAs, poca VRAM e importación de workflows de la comunidad. - [Fish Audio Tts](https://skillsagentes.com/skills/calesthio/openmontage/fish-audio-tts.md): Genera narración expresiva y multilingüe con fish.audio (modelos S1 / S2) y reutiliza voces clonadas mediante reference_id. - [Minimax H3](https://skillsagentes.com/skills/calesthio/openmontage/minimax-h3.md): Genera vídeo con MiniMax H3 (Hailuo 3.0) por la API oficial v2, fal.ai, Runway, nodos partner de ComfyUI o pesos abiertos locales. Clips de 4-15s a 2K con animación de primer/último fotograma. - [Gemini Omni](https://skillsagentes.com/skills/calesthio/openmontage/gemini-omni.md): Genera y edita conversacionalmente vídeos cortos con Google Gemini Omni Flash: itera con ediciones en lenguaje natural, clips de 3-10s a 720p con audio y texto en pantalla, e imágenes de referencia por etiquetas. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)