Skip to content

responsivevoice/text

Repository files navigation

ResponsiveVoice logo

@responsivevoice/text

CI

Text processing utilities for ResponsiveVoice TTS — chunking, duration estimation, and hashing.

npm version npm downloads GitHub License: MIT


Internal package — published as a dependency of @responsivevoice/core. You usually do not install this directly.

Installation

npm install @responsivevoice/text

Usage

import {
  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');

API

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

License

MIT


Other language SDKs: Python · Go · PHP · Java

AI coding agents: install the ResponsiveVoice skillnpx skills add responsivevoice/skills

About

Text processing & normalization utilities for ResponsiveVoice text-to-speech (TTS)

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors