lobe-tts  by lobehub

TTS/STT library for server and browser apps

created 1 year ago
646 stars

Top 52.5% on sourcepulse

GitHubView on GitHub
Project Summary

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

  • Install: pnpm i @lobehub/tts or bun add @lobehub/tts
  • Prerequisites: Node.js environment. For Node.js, WebSocket polyfill (import WebSocket from 'ws'; global.WebSocket = WebSocket;) is required. Next.js projects need transpilePackages: ['@lobehub/tts'] in next.config.js.
  • Docs: https://tts.lobehub.com

Highlighted Details

  • Supports server-side TTS with EdgeSpeechTTS, MicrosoftTTS, and OpenAI TTS.
  • Provides React Hooks (useAudioPlayer) and visual components for browser-based audio playback.
  • Offers extensive customization for audio track styling and timeline interaction.
  • Designed with a focus on high-quality audio output and a smooth user experience.

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

  • License: MIT
  • Compatibility: The library is ESM-only. Compatibility with Next.js SSR is addressed via 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.

Health Check
Last commit

2 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
50 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.