Skip to content

responsivevoice/types

Repository files navigation

ResponsiveVoice logo

@responsivevoice/types

CI

Shared TypeScript type definitions for the ResponsiveVoice text-to-speech ecosystem.

npm version npm downloads GitHub License: MIT

Documentation


Installation

npm install @responsivevoice/types
# or
pnpm add @responsivevoice/types
# or
yarn add @responsivevoice/types

Usage

import type {
  Voice,
  SystemVoice,
  VoiceCollection,
  SynthesizeRequest,
  SynthesizeResponse,
  ResponsiveVoiceConfig,
  RVEventType,
  RVEventCallback,
  TTSService,
  AudioFormat,
  VoiceGender,
} from '@responsivevoice/types';

// Example: Define a synthesize request
const request: SynthesizeRequest = {
  text: 'Hello, world!',
  lang: 'en-US',
  gender: 'female',
  pitch: 0.5,
  rate: 0.5,
  volume: 1.0,
  format: 'mp3',
};

// Example: Configure the client
const config: ResponsiveVoiceConfig = {
  apiKey: 'your-api-key',
  baseUrl: 'https://texttospeech.responsivevoice.org/v2',
  timeout: 30000,
  retryAttempts: 3,
};

Available Types

Core Types

  • VoiceGender - Voice gender ('male' | 'female')
  • VoiceGenderShort - Short gender identifier ('f' | 'm')
  • TTSService - TTS service identifier
  • AudioFormat - Audio output format ('mp3' | 'ogg' | 'wav')

Voice Types

  • Voice - High-level ResponsiveVoice voice definition
  • SystemVoice - Low-level system voice mapping
  • VoiceCollection - Complete voice collection
  • VoiceQuery - Voice filtering options

API Types

  • SynthesizeRequest - TTS synthesis request payload
  • SynthesizeResponse - Synthesis response with audio data
  • AudioResponse - Audio response with playback URL
  • ErrorResponse - API error response structure

Event Types

  • RVEventType - Event type union
  • RVEvent - Event payload
  • RVEventCallback - Event callback function

Configuration Types

  • ResponsiveVoiceConfig - Client configuration
  • SpeakParams - Speech parameters

License

MIT


Other language SDKs: Python · Go · PHP · Java

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

About

Shared TypeScript type definitions for the ResponsiveVoice text-to-speech (TTS) packages

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors