lobe-tts
БесплатноБез исполняемых скриптовНе проверенLobeTTS - High-quality TypeScript TTS/STT toolkit with EdgeSpeech, Microsoft, OpenAI engines, React hooks, audio visualization components, and both server and…
Об этом скилле
LobeTTS Skill
LobeTTS (@lobehub/tts) is a high-quality TypeScript-based toolkit for text-to-speech (TTS) and speech-to-text (STT) functionality. It supports usage both on the server-side and in the browser, offering developers an open-source alternative to proprietary TTS solutions with quality comparable to OpenAI's TTS service.
Key Value Proposition: Generate high-quality speech with minimal code (~15 lines), supporting multiple TTS engines (Edge, Microsoft, OpenAI) with React hooks and audio visualization components for seamless frontend integration.
When to Use This Skill
- Implementing text-to-speech in Node.js applications
- Adding speech synthesis to React/Next.js applications
- Building voice-enabled chatbots or assistants
- Creating audio players with visualization
- Implementing speech-to-text functionality
- Comparing or switching between TTS providers
- Building accessible applications with audio output
When NOT to Use This Skill
- For native mobile TTS (use platform-specific APIs)
- For real-time voice streaming (use WebRTC solutions)
- For voice cloning or custom voice training
- For offline TTS without internet (Edge/Microsoft require connectivity)
Core Concepts
Architecture Overview
┌─────────────────────────────────────────────────────────────────┐
│ @lobehub/tts │
│ (TypeScript Library) │
└─────────────────────────────────────────────────────────────────┘
│
┌─────────────────────┼─────────────────────┐
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ TTS Core │ │ React Hooks │ │ Components │
├───────────────┤ ├───────────────┤ ├───────────────┤
│ EdgeSpeechTTS │ │ useEdgeSpeech │ │ AudioPlayer │
│ MicrosoftTTS │ │ useMicrosoft │ │ AudioVisualzr │
│ OpenAITTS │ │ useOpenAITTS │ │ │
│ OpenAISTT │ │ useOpenAISTT │ │ │
│ SpeechSynth │ │ useTTS │ │ │
└───────────────┘ └───────────────┘ └───────────────┘
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Server │ │ Browser │ │ Styling │
├───────────────┤ ├───────────────┤ ├───────────────┤
│ • Node.js │ │ • React │ │ • Waveforms │
│ • Edge/Vercel │ │ • Next.js │ │ • Progress │
│ • File output │ │ • SPA │ │ • Controls │
└───────────────┘ └───────────────┘ └───────────────┘
Project Statistics
| Metric | Value |
|---|---|
| GitHub Stars | 695+ |
| Forks | 93+ |
| Contributors | 13+ |
| Releases | 100+ |
| Dependents | ~1,500 projects |
| Primary Language | TypeScript (98.8%) |
| License | MIT |
Supported TTS/STT Engines
| Engine | Type | Provider | Quality | Cost |
|---|---|---|---|---|
| EdgeSpeechTTS | TTS | Microsoft Edge | High | Free |
| MicrosoftTTS | TTS | Azure Cognitive | Very High | Paid |
| OpenAITTS | TTS | OpenAI | Premium | Paid |
| OpenAISTT | STT | OpenAI Whisper | Premium | Paid |
| SpeechSynthesisTTS | TTS | Browser Native | Variable | Free |
Installation
Package Installation
# pnpm (recommended)
pnpm add @lobehub/tts
# bun
bun add @lobehub/tts
# npm
npm install @lobehub/tts
# yarn
yarn add @lobehub/tts
Important: This is an ESM-only package.
Next.js Configuration
Add to next.config.js:
/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ['@lobehub/tts'],
};
module.exports = nextConfig;
Node.js WebSocket Polyfill
For server-side usage, polyfill WebSocket:
import WebSocket from 'ws';
global.WebSocket = WebSocket;
Server-Side Usage
EdgeSpeechTTS (Free, High Quality)
import { EdgeSpeechTTS } from '@lobehub/tts';
import { Buffer } from 'buffer';
import fs from 'fs';
import path from 'path';
// Polyfill WebSocket for Node.js
import WebSocket from 'ws';
global.WebSocket = WebSocket;
// Initialize TTS engine
const tts = new EdgeSpeechTTS({ locale: 'en-US' });
// Create speech payload
const payload = {
input: 'Hello! This is a speech demonstration using LobeTTS.',
options: {
voice: 'en-US-GuyNeural',
},
};
// Generate speech
const response = await tts.create(payload);
// Save to file
const mp3Buffer = Buffer.from(await response.arrayBuffer());
const speechFile = path.resolve('./speech.mp3');
fs.writeFileSync(speechFile, mp3Buffer);
console.log(`Speech saved to: ${speechFile}`);
MicrosoftTTS (Azure)
import { MicrosoftSpeechTTS } from '@lobehub/tts';
const tts = new MicrosoftS
Установить lobe-tts в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл lobe-tts?
LobeTTS - High-quality TypeScript TTS/STT toolkit with EdgeSpeech, Microsoft, OpenAI engines, React hooks, audio visualization components, and both server and browser support
Как установить скилл lobe-tts?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл lobe-tts запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic