speech-to-text
Skill72 starsChanged 46 days agoApache-2.0View on GitHub
Write correct Sarvam Saaras STT code for 23 Indic languages — REST modes, Batch API with diarization, and WebSocket streaming gotchas. Use this skill when building transcription or voice apps in Python or JS/TS. For live transcription in chat via MCP, use sarvam-mcp instead.
- Reads credentials
19 other projects use a version of this.
Adopted by
Most recently taken up by
- OpenMontageInc/OpenMontagetheir own version, first seen Nov 8, 2026
- calesthio/OpenMontagetheir own version, first seen Nov 8, 2026
- imMamdouhaboammar/motion-graphics-skillstheir own version, first seen Nov 1, 2026
- wsy1022/china-audit-toolkittheir own version, first seen Nov 1, 2026
- deepgram/skillstheir own version, first seen Oct 25, 2026
- elevenlabs/skillstheir own version, first seen Oct 19, 2026
Used with
Projects with it also use speech-engine, voice-isolator and 4 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
RobStrayerSkillspeech-engine
Add real-time voice conversations to a custom agent runtime with ElevenLabs Speech Engine. Use when building Speech Engine servers, WebSocket handlers, WebRTC browser clients, conversation token endpoints, interruption-aware streaming responses, or voice-enabled chat agents that connect developer-owned server logic to ElevenLabs speech-to-text and text-to-speech.
Also in 3 projects that use this
RobStrayerSkillvoice-isolator
Remove background noise and isolate vocals/speech from audio using ElevenLabs Voice Isolator (audio isolation) API. Use when cleaning up noisy recordings, removing music or background ambience from dialogue, isolating speech from field recordings, preparing audio for transcription, extracting vocals, or any "denoise / clean up / isolate voice" task.
Also in 3 projects that use this
wlzhSkillvoice-changer
音频变声处理工具 - 使用 RVC AI 模型进行真实的声音转换,支持视频直接输入
Also in 3 projects that use this
awesome-genmediaSkillsound-effects
Generate custom sound effects using each::sense AI. Create realistic and stylized audio for any scenario including impacts, ambiences, foley, UI sounds, nature, mechanical effects, and transitions. Powered by stable-audio-2-5 for precise audio generation. Use for: video production, game development, podcasts, apps, UI/UX, presentations, film. Triggers: sound effect, sfx, audio effect, foley, generate sound, ambient sound, ui sound, impact sound, whoosh, explosion, nature sound, notification sound, create audio
Also in 4 projects that use this
marswaveaiSkillmusic
Generate, remix, extend, edit, and analyze AI music (Mureka). Triggers on: "音乐", "music", "生成音乐", "generate music", "翻唱", "cover", "混音", "remix", "续写", "extend", "纯音乐", "instrumental", "配乐", "soundtrack", "分轨", "stem", "识别歌词", "recognize lyrics", "作曲", "compose", "create a song", "做一首歌".
Also in 3 projects that use this
Chinna95PSkillagents
Also in 4 projects that use this
Other versions19 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 19
- calesthio/OpenMontage★ 78ksame name
- OpenMontageInc/OpenMontage★ 78ksame name
- elevenlabs/skills★ 539same name
- NoizAI/skills★ 526same name
- tadaspetra/loop★ 296same name
- imMamdouhaboammar/motion-graphics-skills★ 50same name
- awesome-genmedia/skills★ 36same name
- deepgram/skills★ 26same name
- 0gfoundation/0g-agent-skills★ 15same name
- LinHao-city/StoryMind★ 10same name
9 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- chatSkill
- doc-aiSkill
- dubbingSkill
- sarvam-mcpSkill
- text-to-speechSkill
- vibe-codingSkill
- voice-agentsSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 99
No fixed session duration limit — but the connection closes after 60 seconds of inactivity.
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Speech-to-Text — Saaras
Live in-chat transcription → sarvam-mcp (
sarvam_tools_stt_*). This skill = SDK code.
[!IMPORTANT] Auth:
api-subscription-keyheader — NOTAuthorization: Bearer. Base URL:https://api.sarvam.ai(NOT/v1— that prefix is only for the OpenAI-compatible chat endpoint)
Model
saaras:v3 (default, recommended) — 23 languages, 5 output modes (transcribe, translate, verbatim, translit, codemix), auto language detection.
saaras:v4 (latest) — same modes/languages, plus Global English (not just Indian English) and Keyterm Prompting: pass keyterms=["Sarvam", "New Delhi", ...] (up to 50 terms, 64 chars each) on REST, Batch, or either WebSocket streaming endpoint to bias recognition toward domain-specific names/brands/terms. keyterms is saaras:v4-only — see Gotchas for a JS-specific caveat.
Quick Start (Python)
from sarvamai import SarvamAI
client = SarvamAI()
response = client.speech_to_text.transcribe(
file=open("audio.wav", "rb"),
model="saaras:v3",
mode="transcribe"
)
print(response.transcript)Quick Start (JavaScript/TypeScript)
import { SarvamAIClient } from "sarvamai";
import * as fs from "fs";
const client = new SarvamAIClient({ apiSubscriptionKey: "YOUR_SARVAM_API_KEY" });
const response = await client.speechToText.transcribe({
file: fs.createReadStream("audio.wav"),
model: "saaras:v3",
mode: "transcribe"
});
console.log(response.transcript);Batch API (Long Audio + Diarization)
job = client.speech_to_text_job.create_job(
model="saaras:v3",
mode="transcribe",
language_code="hi-IN",
with_diarization=True,
num_speakers=2
)
job.upload_files(file_paths=["meeting.mp3"])
job.start()
job.wait_until_complete()
job.download_outputs(output_dir="./output")Supports audio up to 2 hours per file, up to 20 files per job, up to 20 speakers (num_speakers), all 5 output modes.
WebSocket Streaming
import asyncio, base64
from sarvamai import AsyncSarvamAI
async def stream_audio():
client = AsyncSarvamAI()
async with client.speech_to_text_streaming.connect(
model="saaras:v3",
language_code="hi-IN", # required — connect() now rejects a missing language_code
high_vad_sensitivity=True,
flush_signal=True
) as ws:
with open("audio.wav", "rb") as f:
audio_base64 = base64.b64encode(f.read()).decode("utf-8")
await ws.transcribe(audio=audio_base64, encoding="audio/wav", sample_rate=16000)
await ws.flush()
response = await ws.recv()
print(response)
asyncio.run(stream_audio())No fixed session duration limit — but the connection closes after 60 seconds of inactivity. Use sample_rate=8000 for telephony audio.
Verified live: connect() currently raises TypeError: ... missing 1 required keyword-only argument: 'language_code' if you omit it — it is not optional in the installed SDK, despite not being marked required in some docs examples.
Realtime Streaming (New — saaras:v3-realtime / saaras:v4)
A newer, separate WebSocket API — not a replacement for the "WebSocket Streaming" above, which still works. Use this one for true interim results and finer turn control.
import asyncio, base64
from sarvamai import AsyncSarvamAI, RealtimeAudioInput, RealtimeEnd
async def transcribe(audio_chunks):
client = AsyncSarvamAI()
async with client.speech_to_text_realtime_streaming.connect(
language_code="hi-IN",
stream_type="fast", # "fast" | "balanced" (default) | "simulated"
) as ws:
async def send_audio():
async for chunk in audio_chunks:
await ws.send_realtime_audio_input(
RealtimeAudioInput(audio=base64.b64encode(chunk).decode("utf-8"))
)
await ws.send_realtime_end(RealtimeEnd())
async def receive_events():
async for message in ws:
if message.event == "transcript.partial":
print(f"partial: {message.text}")
elif message.event == "transcript.final":
print(f"final: {message.text}")
elif message.event == "error":
print(f"error ({message.code}): {message.message}")
await asyncio.gather(send_audio(), receive_events())JS: client.speechToTextRealtimeStreaming.connect({ language_code, stream_type }), then socket.sendRealtimeAudioInput({...}) / socket.sendRealtimeEnd({...}), with events on socket.on("message", ...).
Gotchas
| Gotcha | Detail |
| REST: 30s limit | Audio >30s fails. Use Batch API or WebSocket for longer files. |
| JS method name | client.speechToText.transcribe({...}) — camelCase, NOT speech_to_text. File via fs.createReadStream(). |
| WebSocket codecs | Only wav, pcm_s16le, pcm_l16, pcm_raw. MP3/AAC/OGG NOT supported for streaming. PCM input is 16kHz only. |
| WebSocket audio | Must be base64-encoded. Use sample_rate=8000 for telephony audio. |
| WebSocket idle timeout | Connection closes after 60s of inactivity. For long-running sessions, send periodic silent (near-zero amplitude) audio chunks as keep-alive. |
| Flush signal | flush_signal=True + await ws.flush() forces immediate transcription boundary. |
| VAD events | vad_signals=True emits START_SPEECH/END_SPEECH events alongside transcripts. high_vad_sensitivity=True for automatic end-of-speech detection. |
| Short audio detection | Set language_code explicitly for audio <3 seconds — auto-detection needs more signal. |
keyterms is v4-only | Accepted with model="saaras:v4" on REST, Batch, and both WebSocket streaming endpoints (legacy /speech-to-text/ws and realtime). Verified live: saaras:v3 + keyterms returns 400 — "'keyterms' is only supported by model 'saaras:v4', got 'saaras:v3'." — a hard error, not a silent ignore. Format: JSON list of strings, max 50 terms, 64 chars each — don't use the older keyterm/hotwords fields. |
keyterms JS support | Docs (as of this writing) say JS speechToText.transcribe({..., keyterms}) hasn't shipped to npm, with only speechToTextJob.createJob({..., keyterms}) (Batch) working. Verified live against sarvamai@1.1.10: REST transcribe({..., keyterms}) worked without error — the docs note may already be stale. Don't trust either source blindly; the gap may be closed by the time you read this — test the actual call once. Python needs sarvamai>=0.1.33a1 (REST) / >=0.1.33a3 (Batch) either way. |
| Realtime vs legacy streaming are different endpoints | Legacy WebSocket (/speech-to-text/ws, speech_to_text_streaming) has no interim results and needs a reconnect to change params. Realtime (/speech-to-text-realtime/ws, speech_to_text_realtime_streaming) adds transcript.partial events, millisecond VAD params (threshold, silence_duration_ms, min_speech_duration_ms), and live config.update — don't mix the two APIs' parameter names. |
| Realtime sample rate | Only 8000 or 16000 Hz — any other value closes the connection with code 4000. |
Full Docs
Fetch streaming protocol, batch API SDK examples, and codec details from:
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

