TTS/STT library for server and browser apps
Top 52.5% on sourcepulse
Lobe TTS is a high-quality, TypeScript-based toolkit for Text-to-Speech (TTS) and Speech-to-Text (STT) designed for both server-side and browser environments. It aims to provide developers with a robust and flexible solution for integrating voice capabilities into applications, addressing a perceived gap in readily available, high-quality frontend TTS libraries.
How It Works
The library offers distinct functionalities for server and browser use. Server-side, it supports multiple TTS engines including EdgeSpeechTTS, MicrosoftTTS, and OpenAI TTS, enabling voice generation with minimal code. For browser-based applications, it provides React Hooks and visual audio components that manage audio playback, timeline scrubbing, and visual styling. The architecture emphasizes ease of integration and a rich user experience for audio interactions.
Quick Start & Requirements
pnpm i @lobehub/tts
or bun add @lobehub/tts
import WebSocket from 'ws'; global.WebSocket = WebSocket;
) is required. Next.js projects need transpilePackages: ['@lobehub/tts']
in next.config.js
.Highlighted Details
useAudioPlayer
) and visual components for browser-based audio playback.Maintenance & Community
The project is actively maintained by LobeHub, which also develops related projects like Lobe Chat and Lobe Theme. Community contributions are welcomed via GitHub Issues.
Licensing & Compatibility
transpilePackages
.Limitations & Caveats
The library is ESM-only, which may require specific build configurations for older module systems. While it supports multiple TTS backends, the quality and availability of voices depend on the chosen service.
2 months ago
1 week