text-to-speech-component
v1.1.0
Published
A simple, lightweight React component for Text-to-Speech.
Maintainers
Readme
Text To Speech Component
A simple, lightweight React component that provides a "Text to Speech" interface. It includes a text area for input, voice selection (auto-detecting English voices), and playback controls.
Features
- Plug & Play: Drop it into any React app.
- Auto-Detection: Automatically selects "English (UK) Female" or the best available English voice.
- Smart Chunking: Splits long text into natural chunks for smoother speech.
- Self-Contained: Manages its own state (input text, selected voice, playback).
- Zero Dependencies: Only requires React.
Installation
npm install text-to-speech-componentUsage
- Import the component.
- Import the CSS styles (Required for the layout to look right).
- Render it.
import React from "react";
import { TextToSpeech } from "text-to-speech-component";
// Essential: Import the styles.
import "text-to-speech-component/dist/text-to-speech-component.css";
function App() {
return (
<div className="App">
<TextToSpeech />
</div>
);
}
export default App;