@vite-tts/adapter-sarvam
v0.1.0
Published
Sarvam AI TTS adapter for vite-plugin-tts
Readme
@vite-tts/adapter-sarvam
Sarvam AI (
bulbul:v3) TTS adapter forvite-plugin-tts.
Supports 11 Indian languages plus English with high-quality natural voices and low latency.
📦 Installation
pnpm add -D @vite-tts/adapter-sarvam vite-plugin-tts
# or
npm install -D @vite-tts/adapter-sarvam vite-plugin-tts🚀 Setup
Get an API key from sarvam.ai and add it to .env.local:
echo "SARVAM_API_KEY=your_key_here" >> .env.localIn your vite.config.ts:
import { defineConfig } from 'vite'
import { tts } from 'vite-plugin-tts'
import { sarvam } from '@vite-tts/adapter-sarvam'
export default defineConfig({
plugins: [
tts({
adapter: sarvam({
// apiKey is optional: defaults to process.env.SARVAM_API_KEY
defaultVoice: 'priya',
}),
defaultLang: 'hi-IN',
defaultVoice: 'priya',
defaultFormat: 'wav',
}),
],
})🗣️ Supported Voices (Bulbul v3)
| Voice | Gender | Persona / Tone |
|---|---|---|
| priya | Female | Professional, clear, warm (Default) |
| aditya | Male | Energetic, expressive |
| neha | Female | Conversational, smooth |
| rahul | Male | Deep, narrative |
| pooja | Female | Friendly, gentle |
| rohan | Male | Casual, bright |
| kavya | Female | Expressive, storytelling |
| dev | Male | Formal, news-style |
🌏 Supported Languages
| Code | Language |
|---|---|
| hi-IN | Hindi |
| bn-IN | Bengali |
| ta-IN | Tamil |
| te-IN | Telugu |
| kn-IN | Kannada |
| ml-IN | Malayalam |
| mr-IN | Marathi |
| gu-IN | Gujarati |
| pa-IN | Punjabi |
| or-IN | Odia |
| as-IN | Assamese |
| en-IN | English (India) |
⚙️ Configuration Options
sarvam({
apiKey?: string // Optional. Reads process.env.SARVAM_API_KEY if omitted
defaultVoice?: string // Defaults to 'priya'
model?: string // Defaults to 'bulbul:v3'
baseUrl?: string // Defaults to 'https://api.sarvam.ai/text-to-speech'
})📄 License
MIT
