Text processing utilities for ResponsiveVoice TTS — chunking, duration estimation, and hashing.
Internal package — published as a dependency of
@responsivevoice/core. You usually do not install this directly.
npm install @responsivevoice/textimport {
chunkText,
getEstimatedTimeLength,
djb2Hash,
} from '@responsivevoice/text';
const chunks = chunkText('Long text to split for TTS...', {
characterLimit: 100,
});
const durationMs = getEstimatedTimeLength('Hello, how are you today?');
const hash = djb2Hash('Hello world');| Export | Description |
|---|---|
chunkText |
Split text into chunks respecting sentence/word boundaries |
createTextChunker |
Create a reusable chunker with configured options |
hasCJKContent |
Detect CJK characters for language-aware chunking |
getEstimatedTimeLength |
Estimate speech duration in ms (with text preprocessing) |
getEstimatedTimeLengthWithRate |
Estimate duration adjusted for speech rate |
djb2Hash |
Fast DJB2 string hash |
MIT
Other language SDKs: Python · Go · PHP · Java
AI coding agents: install the ResponsiveVoice skill — npx skills add responsivevoice/skills