Skip to content

@responsivevoice/types

Shared TypeScript types, Zod schemas, and runtime type guards used across the @responsivevoice/* packages. The Zod schemas are the single source of truth for runtime validation; TypeScript types are inferred via z.infer<>.

type AudioFormat = z.infer<typeof AudioFormatSchema>;

Defined in: src/schemas/core.ts:69

Inferred from AudioFormatSchema.


type AudioResponse = z.infer<typeof AudioResponseSchema>;

Defined in: src/schemas/synthesis.ts:146

Inferred from AudioResponseSchema.


type AuthToken = z.infer<typeof AuthTokenSchema>;

Defined in: src/schemas/website.ts:361

Inferred from AuthTokenSchema.


type BrowserVoiceInfo = z.infer<typeof BrowserVoiceInfoSchema>;

Defined in: src/schemas/responses.ts:43

Inferred from BrowserVoiceInfoSchema.


type ByLanguageLinks = z.infer<typeof ByLanguageLinksSchema>;

Defined in: src/schemas/responses.ts:244

Inferred from ByLanguageLinksSchema.


type CollectionLinks = z.infer<typeof CollectionLinksSchema>;

Defined in: src/schemas/responses.ts:231

Inferred from CollectionLinksSchema.


type DeviceType = z.infer<typeof DeviceTypeSchema>;

Defined in: src/schemas/responses.ts:18

Inferred from DeviceTypeSchema.


type ErrorResponse = z.infer<typeof ErrorResponseSchema>;

Defined in: src/schemas/responses.ts:133

Inferred from ErrorResponseSchema.


type HrefLink = z.infer<typeof HrefLinkSchema>;

Defined in: src/schemas/responses.ts:146

Inferred from HrefLinkSchema.


type MiniPlayer = z.infer<typeof MiniPlayerSchema>;

Defined in: src/schemas/website.ts:170

Inferred from MiniPlayerSchema.


type MiniPlayerCorner = z.infer<typeof MiniPlayerCornerSchema>;

Defined in: src/schemas/website.ts:122

Inferred from MiniPlayerCornerSchema.


type MiniPlayerOffset = z.infer<typeof MiniPlayerOffsetSchema>;

Defined in: src/schemas/website.ts:151

Inferred from MiniPlayerOffsetSchema.


type PlatformReport = z.infer<typeof PlatformReportSchema>;

Defined in: src/schemas/responses.ts:67

Inferred from PlatformReportSchema.


type ProsodyKnob = typeof PROSODY_KNOBS[number];

Defined in: src/schemas/prosody.ts:15

Inferred union from PROSODY_KNOBS.


type RegexSelector = z.infer<typeof RegexSelectorSchema>;

Defined in: src/schemas/voice-query.ts:58

Inferred from RegexSelectorSchema.


type ResponsiveVoiceConfig = z.infer<typeof ResponsiveVoiceConfigSchema>;

Defined in: src/schemas/synthesis.ts:190

Inferred from ResponsiveVoiceConfigSchema.


type RVErrorEvent = z.infer<typeof RVErrorEventSchema>;

Defined in: src/schemas/events.ts:46

Inferred from RVErrorEventSchema.


type RVEvent = z.infer<typeof RVEventSchema>;

Defined in: src/schemas/events.ts:21

Inferred from RVEventSchema.


type RVEventCallback = (event) => void;

Defined in: src/schemas/events.ts:31

Listener invoked by ResponsiveVoice for each dispatched RVEvent.

ParameterType
eventRVEvent

void


type RVEventType = z.infer<typeof RVEventTypeSchema>;

Defined in: src/schemas/core.ts:142

Inferred from RVEventTypeSchema.


type RVServiceSwitchedEvent = z.infer<typeof RVServiceSwitchedEventSchema>;

Defined in: src/schemas/events.ts:68

Inferred from RVServiceSwitchedEventSchema.


type ServiceOrNative = z.infer<typeof ServiceOrNativeSchema>;

Defined in: src/schemas/events.ts:53

Inferred from ServiceOrNativeSchema.


type SpeakParams = {
onboundary?: (charIndex, name) => void;
onend?: () => void;
onerror?: (error) => void;
onstart?: () => void;
pitch?: number;
prosodyFallback?: boolean;
rate?: number;
volume?: number;
};

Defined in: src/schemas/synthesis.ts:219

Parameters accepted by ResponsiveVoice.speak(). Controls pitch, rate, volume, and the speech lifecycle event callbacks (onstart, onend, onerror, onvoiceschanged, onboundary). Defined as a hand-authored TypeScript type rather than z.infer&lt;> so callback signatures stay precise.

optional onboundary?: (charIndex, name) => void;

Defined in: src/schemas/synthesis.ts:234

Called when speech crosses a word or sentence boundary

ParameterTypeDescription
charIndexnumberCharacter index in the original text
namestringType of boundary ('word' or 'sentence')

void

Only supported by native Web Speech API engine, not fallback audio engine

optional onend?: () => void;

Defined in: src/schemas/synthesis.ts:226

void

optional onerror?: (error) => void;

Defined in: src/schemas/synthesis.ts:227

ParameterType
errorError

void

optional onstart?: () => void;

Defined in: src/schemas/synthesis.ts:225

void

optional pitch?: number;

Defined in: src/schemas/synthesis.ts:220

optional prosodyFallback?: boolean;

Defined in: src/schemas/synthesis.ts:224

Per-call override for client-side prosody fallback. See ResponsiveVoiceConfigSchema for the default.

optional rate?: number;

Defined in: src/schemas/synthesis.ts:221

optional volume?: number;

Defined in: src/schemas/synthesis.ts:222


type SpeechParams = z.infer<typeof SpeechParamsSchema>;

Defined in: src/schemas/synthesis.ts:50

Inferred from SpeechParamsSchema.


type StreamAudioChunk = z.infer<typeof StreamAudioChunkSchema>;

Defined in: src/schemas/streaming.ts:39

Inferred from StreamAudioChunkSchema.


type StreamChunk =
| StreamMetadata
| StreamAudioChunk
| StreamEnd
| StreamError;

Defined in: src/schemas/streaming.ts:70

Union of all streaming chunk types


type StreamEnd = z.infer<typeof StreamEndSchema>;

Defined in: src/schemas/streaming.ts:52

Inferred from StreamEndSchema.


type StreamError = z.infer<typeof StreamErrorSchema>;

Defined in: src/schemas/streaming.ts:65

Inferred from StreamErrorSchema.


type StreamingTransportMode = z.infer<typeof StreamingTransportModeSchema>;

Defined in: src/schemas/core.ts:173

Inferred from StreamingTransportModeSchema.


type StreamMetadata = z.infer<typeof StreamMetadataSchema>;

Defined in: src/schemas/streaming.ts:26

Inferred from StreamMetadataSchema.


type StreamWebsocketLink = z.infer<typeof StreamWebsocketLinkSchema>;

Defined in: src/schemas/responses.ts:193

Inferred from StreamWebsocketLinkSchema.


type SynthesizeLink = z.infer<typeof SynthesizeLinkSchema>;

Defined in: src/schemas/responses.ts:157

Inferred from SynthesizeLinkSchema.


type SynthesizeRequest = z.infer<typeof SynthesizeRequestSchema>;

Defined in: src/schemas/synthesis.ts:99

Inferred from SynthesizeRequestSchema.


type SynthesizeResponse = z.infer<typeof SynthesizeResponseSchema>;

Defined in: src/schemas/synthesis.ts:118

Inferred from SynthesizeResponseSchema.


type SynthesizeStreamLink = z.infer<typeof SynthesizeStreamLinkSchema>;

Defined in: src/schemas/responses.ts:177

Inferred from SynthesizeStreamLinkSchema.


type SystemVoice = z.infer<typeof SystemVoiceSchema>;

Defined in: src/schemas/voice.ts:91

Inferred from SystemVoiceSchema.


type TextFeature = z.infer<typeof TextFeatureSchema>;

Defined in: src/schemas/website.ts:29

Inferred from TextFeatureSchema.


type ToggleFeature = z.infer<typeof ToggleFeatureSchema>;

Defined in: src/schemas/website.ts:36

Inferred from ToggleFeatureSchema.


type TransportMode = z.infer<typeof TransportModeSchema>;

Defined in: src/schemas/core.ts:162

Inferred from TransportModeSchema.


type TTSService = z.infer<typeof TTSServiceSchema>;

Defined in: src/schemas/core.ts:56

Inferred from TTSServiceSchema.


type Voice = z.infer<typeof VoiceSchema>;

Defined in: src/schemas/voice.ts:45

Inferred from VoiceSchema.


type VoiceCollection = z.infer<typeof VoiceCollectionSchema>;

Defined in: src/schemas/voice.ts:112

Inferred from VoiceCollectionSchema.


type VoiceDetailLinks = z.infer<typeof VoiceDetailLinksSchema>;

Defined in: src/schemas/responses.ts:219

Inferred from VoiceDetailLinksSchema.


type VoiceDetailResponse = z.infer<typeof VoiceDetailResponseSchema>;

Defined in: src/schemas/responses.ts:302

Inferred from VoiceDetailResponseSchema.


type VoiceGender = z.infer<typeof VoiceGenderSchema>;

Defined in: src/schemas/core.ts:26

Inferred from VoiceGenderSchema.


type VoiceGenderShort = z.infer<typeof VoiceGenderShortSchema>;

Defined in: src/schemas/core.ts:36

Inferred from VoiceGenderShortSchema.


type VoiceLinks = z.infer<typeof VoiceLinksSchema>;

Defined in: src/schemas/responses.ts:205

Inferred from VoiceLinksSchema.


type VoiceQuery = z.infer<typeof VoiceQuerySchema>;

Defined in: src/schemas/voice-query.ts:44

Inferred from VoiceQuerySchema.


type VoiceReportRequest = z.infer<typeof VoiceReportRequestSchema>;

Defined in: src/schemas/responses.ts:88

Inferred from VoiceReportRequestSchema.


type VoiceReportResponse = z.infer<typeof VoiceReportResponseSchema>;

Defined in: src/schemas/responses.ts:106

Inferred from VoiceReportResponseSchema.


type VoicesByLanguageResponse = z.infer<typeof VoicesByLanguageResponseSchema>;

Defined in: src/schemas/responses.ts:289

Inferred from VoicesByLanguageResponseSchema.


type VoiceSelector = z.infer<typeof VoiceSelectorSchema>;

Defined in: src/schemas/voice-query.ts:81

Post-parse output — what consumers (resolvers, server responses) see.


type VoiceSelectorInput =
| string
| RegExp
| RegexSelector
| VoiceQuery;

Defined in: src/schemas/voice-query.ts:86

Input form callers may write. JS callers can pass a real RegExp as sugar for RegexSelector; the schema normalizes it on parse.


type VoicesListResponse = z.infer<typeof VoicesListResponseSchema>;

Defined in: src/schemas/responses.ts:274

Inferred from VoicesListResponseSchema.


type VoiceWithLinks = z.infer<typeof VoiceWithLinksSchema>;

Defined in: src/schemas/responses.ts:254

Inferred from VoiceWithLinksSchema.


type WebPlayerControls = z.infer<typeof WebPlayerControlsSchema>;

Defined in: src/schemas/website.ts:96

Inferred from WebPlayerControlsSchema.


type WebPlayerFeature = z.infer<typeof WebPlayerFeatureSchema>;

Defined in: src/schemas/website.ts:266

Inferred from WebPlayerFeatureSchema.


type WebPlayerLayout = z.infer<typeof WebPlayerLayoutSchema>;

Defined in: src/schemas/website.ts:185

Inferred from WebPlayerLayoutSchema.


type WebPlayerNavigation = z.infer<typeof WebPlayerNavigationSchema>;

Defined in: src/schemas/website.ts:112

Inferred from WebPlayerNavigationSchema.


type WebPlayerSanitize = z.infer<typeof WebPlayerSanitizeSchema>;

Defined in: src/schemas/website.ts:199

Inferred from WebPlayerSanitizeSchema.


type WebPlayerTheme = z.infer<typeof WebPlayerThemeSchema>;

Defined in: src/schemas/website.ts:75

Inferred from WebPlayerThemeSchema.


type WebPlayerThemeTokens = z.infer<typeof WebPlayerThemeTokensSchema>;

Defined in: src/schemas/website.ts:64

Inferred from WebPlayerThemeTokensSchema.


type WebsiteAnalytics = z.infer<typeof WebsiteAnalyticsSchema>;

Defined in: src/schemas/website.ts:346

Inferred from WebsiteAnalyticsSchema.


type WebsiteConfigResponse = z.infer<typeof WebsiteConfigResponseSchema>;

Defined in: src/schemas/website.ts:380

Inferred from WebsiteConfigResponseSchema.


type WebsiteFeatures = z.infer<typeof WebsiteFeaturesSchema>;

Defined in: src/schemas/website.ts:325

Inferred from WebsiteFeaturesSchema.


type WebsiteVoice = z.infer<typeof WebsiteVoiceSchema>;

Defined in: src/schemas/website.ts:337

Inferred from WebsiteVoiceSchema.


type WelcomeMessageFeature = z.infer<typeof WelcomeMessageFeatureSchema>;

Defined in: src/schemas/website.ts:21

Inferred from WelcomeMessageFeatureSchema.

const API_VERSION: "v2";

Defined in: src/schemas/core.ts:12

Current API version used by the SDK and documented in OpenAPI


const AUDIO_FORMATS: ("mp3" | "ogg" | "wav")[] = AudioFormatSchema.options;

Defined in: src/schemas/core.ts:72

Valid audio format values for runtime validation


const AudioFormatSchema: ZodEnum&lt;{
mp3: "mp3";
ogg: "ogg";
wav: "wav";
}>;

Defined in: src/schemas/core.ts:64

Supported audio output formats


const AudioResponseSchema: ZodObject&lt;{
blob: ZodCustom<Blob, Blob>;
duration: ZodOptional<ZodNumber>;
format: ZodEnum&lt;{
mp3: "mp3";
ogg: "ogg";
wav: "wav";
}>;
prosodyApplied: ZodArray<ZodEnum&lt;{
pitch: "pitch";
rate: "rate";
volume: "volume";
}>>;
url: ZodString;
}, $strip>;

Defined in: src/schemas/synthesis.ts:123

Audio response wrapper with metadata


const AuthTokenSchema: ZodObject&lt;{
exp: ZodNumber;
token: ZodString;
}, $strip>;

Defined in: src/schemas/website.ts:352

Short-lived bearer token returned by /v2/config. The SDK carries it as Authorization: Bearer <token> on subsequent /v2/* requests. May be absent.


const BrowserVoiceInfoSchema: ZodObject&lt;{
default: ZodOptional<ZodBoolean>;
lang: ZodString;
localService: ZodBoolean;
name: ZodString;
voiceURI: ZodString;
}, $strip>;

Defined in: src/schemas/responses.ts:24

Browser voice information from Web Speech API Represents a SpeechSynthesisVoice as reported by the browser


const ByLanguageLinksSchema: ZodObject&lt;{
allVoices: ZodObject&lt;{
href: ZodString;
}, $strip>;
self: ZodObject&lt;{
href: ZodString;
}, $strip>;
}, $strip>;

Defined in: src/schemas/responses.ts:234

Collection-level HATEOAS links on GET /v2/voices/by-language/{lang}.


const CollectionLinksSchema: ZodObject&lt;{
self: ZodObject&lt;{
href: ZodString;
}, $strip>;
}, $strip>;

Defined in: src/schemas/responses.ts:222

Collection-level HATEOAS links on GET /v2/voices.


const DEFAULT_ENGINE_FORMAT: Record<TTSService, AudioFormat>;

Defined in: src/schemas/core.ts:98

Default audio format for each TTS engine. Used when no explicit format is requested.


const DEFAULT_WEBSITE_FEATURES: {
accessibilityNavigation: {
enabled: false;
};
exitIntent: {
enabled: false;
text: null;
};
paragraphNavigation: {
enabled: false;
};
speakEndPage: {
enabled: false;
text: null;
};
speakInactivity: {
enabled: false;
text: null;
};
speakLinks: {
enabled: false;
};
speakSelectedText: {
enabled: false;
};
webPlayer: {
controls: {
brand: true;
progress: true;
skip: true;
speed: true;
time: true;
};
enabled: false;
layout: {
display: "block";
mode: "shrink";
};
miniPlayer: {
animation: "slide";
enabled: true;
position: "bottom-left";
};
navigation: {
paragraphClick: true;
paragraphHighlight: true;
};
paragraphSelector: "p, h2, h3, li";
position: "before";
sanitize: {
enabled: true;
exclude: string[];
};
selector: "article";
theme: "neutral";
};
welcomeMessage: {
enabled: false;
text: null;
};
welcomeMessageOnce: false;
};

Defined in: src/schemas/website.ts:269

Baseline defaults applied when a website config omits a feature flag.

readonly accessibilityNavigation: {
enabled: false;
};
readonly enabled: false = false;
readonly exitIntent: {
enabled: false;
text: null;
};
readonly enabled: false = false;
readonly text: null = null;
readonly paragraphNavigation: {
enabled: false;
};
readonly enabled: false = false;
readonly speakEndPage: {
enabled: false;
text: null;
};
readonly enabled: false = false;
readonly text: null = null;
readonly speakInactivity: {
enabled: false;
text: null;
};
readonly enabled: false = false;
readonly text: null = null;
readonly speakLinks: {
enabled: false;
};
readonly enabled: false = false;
readonly speakSelectedText: {
enabled: false;
};
readonly enabled: false = false;
readonly webPlayer: {
controls: {
brand: true;
progress: true;
skip: true;
speed: true;
time: true;
};
enabled: false;
layout: {
display: "block";
mode: "shrink";
};
miniPlayer: {
animation: "slide";
enabled: true;
position: "bottom-left";
};
navigation: {
paragraphClick: true;
paragraphHighlight: true;
};
paragraphSelector: "p, h2, h3, li";
position: "before";
sanitize: {
enabled: true;
exclude: string[];
};
selector: "article";
theme: "neutral";
};
readonly controls: {
brand: true;
progress: true;
skip: true;
speed: true;
time: true;
};
readonly brand: true = true;
readonly progress: true = true;
readonly skip: true = true;
readonly speed: true = true;
readonly time: true = true;
readonly enabled: false = false;
readonly layout: {
display: "block";
mode: "shrink";
};
readonly display: "block" = 'block';
readonly mode: "shrink" = 'shrink';
readonly miniPlayer: {
animation: "slide";
enabled: true;
position: "bottom-left";
};
readonly animation: "slide" = 'slide';
readonly enabled: true = true;
readonly position: "bottom-left" = 'bottom-left';
readonly navigation: {
paragraphClick: true;
paragraphHighlight: true;
};
readonly paragraphClick: true = true;
readonly paragraphHighlight: true = true;
readonly paragraphSelector: "p, h2, h3, li" = 'p, h2, h3, li';
readonly position: "before" = 'before';
readonly sanitize: {
enabled: true;
exclude: string[];
};
readonly enabled: true = true;
readonly exclude: string[];
readonly selector: "article" = 'article';
readonly theme: "neutral" = 'neutral';
readonly welcomeMessage: {
enabled: false;
text: null;
};
readonly enabled: false = false;
readonly text: null = null;
readonly welcomeMessageOnce: false = false;

const DeviceTypeSchema: ZodEnum&lt;{
desktop: "desktop";
mobile: "mobile";
tablet: "tablet";
}>;

Defined in: src/schemas/responses.ts:16

Device type classification for voice reporting


const ENGINE_SUPPORTED_FORMATS: Record<TTSService, readonly AudioFormat[]>;

Defined in: src/schemas/core.ts:84

Supported audio formats per TTS engine.

  • Free providers (g1, g2, g3) only produce MP3
  • g5 only produces OGG
  • BYOK providers support multiple formats via their native APIs:
    • gwn (Google Cloud): MP3 and OGG_OPUS
    • msv (Azure): MP3, OGG, and WAV
    • oai (OpenAI): MP3, OGG (Opus), and WAV

const ErrorResponseSchema: ZodObject&lt;{
error: ZodObject&lt;{
code: ZodOptional<ZodString>;
errors: ZodOptional<ZodUnknown>;
message: ZodString;
statusCode: ZodNumber;
}, $strip>;
}, $strip>;

Defined in: src/schemas/responses.ts:115

Standard API error response matching error-handler.ts format


const EVENT_TYPES: (
| "OnLoad"
| "OnReady"
| "OnStart"
| "OnEnd"
| "OnError"
| "OnPause"
| "OnResume"
| "OnServiceSwitched"
| "OnClickEvent"
| "OnAllowSpeechClicked"
| "OnPartStart"
| "OnPartEnd"
| "OnVoiceResolved")[] = RVEventTypeSchema.options;

Defined in: src/schemas/core.ts:145

Valid event type values for runtime validation


const HrefLinkSchema: ZodObject&lt;{
href: ZodString;
}, $strip>;

Defined in: src/schemas/responses.ts:140

Simple HATEOAS link with an absolute URL.


const MiniPlayerCornerSchema: ZodEnum&lt;{
bottom-left: "bottom-left";
bottom-right: "bottom-right";
top-left: "top-left";
top-right: "top-right";
}>;

Defined in: src/schemas/website.ts:115

Mini-player corner placement keywords.


const MiniPlayerOffsetSchema: ZodObject&lt;{
bottom: ZodOptional<ZodString>;
left: ZodOptional<ZodString>;
right: ZodOptional<ZodString>;
top: ZodOptional<ZodString>;
}, $strip>;

Defined in: src/schemas/website.ts:129

Mini-player CSS-offset placement. Each side is a CSS length string (e.g. '80px', '2rem', '5%'). At least one side is required; top+bottom and left+right combinations are rejected.


const MiniPlayerSchema: ZodObject&lt;{
animation: ZodDefault<ZodEnum&lt;{
fade: "fade";
none: "none";
pop: "pop";
slide: "slide";
}>>;
enabled: ZodDefault<ZodBoolean>;
position: ZodDefault<ZodUnion<readonly [ZodEnum&lt;{
bottom-left: "bottom-left";
bottom-right: "bottom-right";
top-left: "top-left";
top-right: "top-right";
}>, ZodObject&lt;{
bottom: ZodOptional<ZodString>;
left: ZodOptional<ZodString>;
right: ZodOptional<ZodString>;
top: ZodOptional<ZodString>;
}, $strip>]>>;
}, $strip>;

Defined in: src/schemas/website.ts:157

Mini-player configuration — visibility and viewport placement. position accepts a corner keyword or an offset object; default is bottom-left.


const PitchSchema: ZodNumber;

Defined in: src/schemas/synthesis.ts:26

Voice pitch range (0–2; 1 = normal).


const PlatformReportSchema: ZodObject&lt;{
browser: ZodString;
browserVersion: ZodString;
deviceType: ZodOptional<ZodEnum&lt;{
desktop: "desktop";
mobile: "mobile";
tablet: "tablet";
}>>;
os: ZodString;
osVersion: ZodString;
}, $strip>;

Defined in: src/schemas/responses.ts:48

Platform information for voice reporting


const PROSODY_KNOBS: readonly ["pitch", "rate", "volume"];

Defined in: src/schemas/prosody.ts:12

The complete set of prosody knobs the v2 API recognises. Order is stable and used for deterministic header formatting.


const ProsodyAppliedHeaderSchema: ZodString;

Defined in: src/schemas/prosody.ts:26

Wire shape for the RV-Prosody-Applied response header — a comma-separated subset of the prosody knob alphabet, in any order. Empty string means the server applied none of the requested knobs (client should run its own fallback per its prosodyFallback policy).


const ProsodyKnobSchema: ZodEnum&lt;{
pitch: "pitch";
rate: "rate";
volume: "volume";
}>;

Defined in: src/schemas/prosody.ts:18

Zod enum over PROSODY_KNOBS.


const RateSchema: ZodNumber;

Defined in: src/schemas/synthesis.ts:28

Speech rate range (0–2; 1 = normal).


const RegexSelectorSchema: ZodObject&lt;{
flags: ZodOptional<ZodString>;
regex: ZodString;
}, $strip>;

Defined in: src/schemas/voice-query.ts:51

JSON-serializable regex literal for VoiceSelectorSchema. Used in place of a runtime RegExp so the selector can travel over the wire and appear in OpenAPI / SDKs in every language.


const ResponsiveVoiceConfigSchema: ZodObject&lt;{
apiKey: ZodString;
apiSecret: ZodOptional<ZodString>;
baseUrl: ZodOptional<ZodString>;
debug: ZodOptional<ZodBoolean>;
defaultLang: ZodOptional<ZodString>;
defaultVoice: ZodOptional<ZodString>;
preferNative: ZodOptional<ZodBoolean>;
retryAttempts: ZodOptional<ZodNumber>;
timeout: ZodOptional<ZodNumber>;
}, $strip>;

Defined in: src/schemas/synthesis.ts:155

ResponsiveVoice client configuration


const RVErrorEventSchema: ZodObject&lt;{
code: ZodOptional<ZodString>;
message: ZodString;
timestamp: ZodNumber;
type: ZodLiteral&lt;"OnError">;
}, $strip>;

Defined in: src/schemas/events.ts:36

Error event with additional error information


const RVEventCallbackSchema: ZodFunction&lt;$ZodFunctionArgs, $ZodFunctionOut>;

Defined in: src/schemas/events.ts:29

Runtime validator for event callbacks. See RVEventCallback for the TS signature.


const RVEventSchema: ZodObject&lt;{
timestamp: ZodNumber;
type: ZodEnum&lt;{
OnAllowSpeechClicked: "OnAllowSpeechClicked";
OnClickEvent: "OnClickEvent";
OnEnd: "OnEnd";
OnError: "OnError";
OnLoad: "OnLoad";
OnPartEnd: "OnPartEnd";
OnPartStart: "OnPartStart";
OnPause: "OnPause";
OnReady: "OnReady";
OnResume: "OnResume";
OnServiceSwitched: "OnServiceSwitched";
OnStart: "OnStart";
OnVoiceResolved: "OnVoiceResolved";
}>;
}, $strip>;

Defined in: src/schemas/events.ts:13

Base event interface


const RVEventTypeSchema: ZodEnum&lt;{
OnAllowSpeechClicked: "OnAllowSpeechClicked";
OnClickEvent: "OnClickEvent";
OnEnd: "OnEnd";
OnError: "OnError";
OnLoad: "OnLoad";
OnPartEnd: "OnPartEnd";
OnPartStart: "OnPartStart";
OnPause: "OnPause";
OnReady: "OnReady";
OnResume: "OnResume";
OnServiceSwitched: "OnServiceSwitched";
OnStart: "OnStart";
OnVoiceResolved: "OnVoiceResolved";
}>;

Defined in: src/schemas/core.ts:126

ResponsiveVoice event types


const RVServiceSwitchedEventSchema: ZodObject&lt;{
from: ZodUnion<readonly [ZodEnum&lt;{
g1: "g1";
g2: "g2";
g3: "g3";
g5: "g5";
gwn: "gwn";
msv: "msv";
oai: "oai";
}>, ZodLiteral&lt;"native">]>;
timestamp: ZodNumber;
to: ZodUnion<readonly [ZodEnum&lt;{
g1: "g1";
g2: "g2";
g3: "g3";
g5: "g5";
gwn: "gwn";
msv: "msv";
oai: "oai";
}>, ZodLiteral&lt;"native">]>;
type: ZodLiteral&lt;"OnServiceSwitched">;
}, $strip>;

Defined in: src/schemas/events.ts:58

Service switched event


const ServiceOrNativeSchema: ZodUnion<readonly [ZodEnum&lt;{
g1: "g1";
g2: "g2";
g3: "g3";
g5: "g5";
gwn: "gwn";
msv: "msv";
oai: "oai";
}>, ZodLiteral&lt;"native">]>;

Defined in: src/schemas/events.ts:51

Service or native source for service switching


const SpeakParamsSchema: ZodObject&lt;{
onend: ZodOptional<ZodFunction&lt;$ZodFunctionArgs, $ZodFunctionOut>>;
onerror: ZodOptional<ZodFunction&lt;$ZodFunctionArgs, $ZodFunctionOut>>;
onstart: ZodOptional<ZodFunction&lt;$ZodFunctionArgs, $ZodFunctionOut>>;
pitch: ZodOptional<ZodNumber>;
prosodyFallback: ZodOptional<ZodBoolean>;
rate: ZodOptional<ZodNumber>;
volume: ZodOptional<ZodNumber>;
}, $strip>;

Defined in: src/schemas/synthesis.ts:195

Speech parameters for speak() method


const SpeechParamsSchema: ZodObject&lt;{
pitch: ZodOptional<ZodNumber>;
rate: ZodOptional<ZodNumber>;
volume: ZodOptional<ZodNumber>;
}, $strip>;

Defined in: src/schemas/synthesis.ts:41

Numeric speech parameters as a reusable, all-optional shape. Spread via ...SpeechParamsSchema.shape into any schema that wants pitch / rate / volume overrides — SynthesizeRequestSchema, SpeakParamsSchema, WebPlayerFeatureSchema, and any future consumer. Field-level documentation lives here so the constraints and the meaning live in one place; consumer comments only describe context-specific behavior (e.g. "inherits website default when omitted").


const StreamAudioChunkSchema: ZodObject&lt;{
chunkIndex: ZodNumber;
data: ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
type: ZodLiteral&lt;"audio">;
}, $strip>;

Defined in: src/schemas/streaming.ts:31

A chunk of audio data from the stream


const StreamEndSchema: ZodObject&lt;{
totalBytes: ZodNumber;
totalChunks: ZodNumber;
type: ZodLiteral&lt;"end">;
}, $strip>;

Defined in: src/schemas/streaming.ts:44

End-of-stream marker with summary statistics


const StreamErrorSchema: ZodObject&lt;{
message: ZodString;
retryable: ZodBoolean;
type: ZodLiteral&lt;"error">;
}, $strip>;

Defined in: src/schemas/streaming.ts:57

Stream error event


const STREAMING_ACCEPT_TYPE: "text/event-stream";

Defined in: src/schemas/core.ts:186

The Accept header value that clients MUST send for streaming synthesis requests. Used by both the client (to set the header) and the server (to validate it). This acts as a protocol-level signal alongside stream: true in the body, enabling infrastructure (e.g. Traefik) to route streaming requests correctly and providing defense-in-depth against forged requests.


const StreamingTransportModeSchema: ZodEnum&lt;{
stream: "stream";
websocket: "websocket";
}>;

Defined in: src/schemas/core.ts:171

Streaming-only transport modes (excludes 'chunks'). Used when MSE progressive playback is required.


const StreamMetadataSchema: ZodObject&lt;{
contentType: ZodString;
prosodyApplied: ZodArray<ZodEnum&lt;{
pitch: "pitch";
rate: "rate";
volume: "volume";
}>>;
type: ZodLiteral&lt;"metadata">;
}, $strip>;

Defined in: src/schemas/streaming.ts:15

Metadata about a streaming synthesis session. First chunk emitted when streaming begins.


const StreamWebsocketLinkSchema: ZodObject&lt;{
href: ZodString;
message: ZodObject&lt;{
lang: ZodOptional<ZodString>;
type: ZodString;
voice: ZodString;
}, $strip>;
premium: ZodBoolean;
protocol: ZodLiteral&lt;"websocket">;
}, $strip>;

Defined in: src/schemas/responses.ts:180

WebSocket stream action link.


const SynthesizeLinkSchema: ZodObject&lt;{
body: ZodObject&lt;{
lang: ZodOptional<ZodString>;
voice: ZodString;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
}, $strip>;

Defined in: src/schemas/responses.ts:149

Synthesize action link on a voice resource.


const SynthesizeRequestSchema: ZodObject&lt;{
engine: ZodOptional<ZodEnum&lt;{
g1: "g1";
g2: "g2";
g3: "g3";
g5: "g5";
gwn: "gwn";
msv: "msv";
oai: "oai";
}>>;
format: ZodOptional<ZodEnum&lt;{
mp3: "mp3";
ogg: "ogg";
wav: "wav";
}>>;
gender: ZodOptional<ZodEnum&lt;{
female: "female";
male: "male";
}>>;
lang: ZodOptional<ZodString>;
name: ZodOptional<ZodString>;
pitch: ZodOptional<ZodNumber>;
rate: ZodOptional<ZodNumber>;
text: ZodString;
voice: ZodOptional<ZodString>;
volume: ZodOptional<ZodNumber>;
}, $strip>;

Defined in: src/schemas/synthesis.ts:59

Request parameters for text-to-speech synthesis


const SynthesizeResponseSchema: ZodObject&lt;{
audio: ZodCustom<ArrayBuffer, ArrayBuffer>;
contentType: ZodString;
duration: ZodOptional<ZodNumber>;
size: ZodNumber;
}, $strip>;

Defined in: src/schemas/synthesis.ts:104

Response from text-to-speech synthesis


const SynthesizeStreamLinkSchema: ZodObject&lt;{
accept: ZodLiteral&lt;"text/event-stream">;
body: ZodObject&lt;{
lang: ZodOptional<ZodString>;
stream: ZodBoolean;
voice: ZodString;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
premium: ZodBoolean;
}, $strip>;

Defined in: src/schemas/responses.ts:160

Streaming synthesize action link (HTTP audio streaming).


const SystemVoiceSchema: ZodObject&lt;{
deprecated: ZodOptional<ZodBoolean>;
fallbackVoice: ZodOptional<ZodBoolean>;
gender: ZodOptional<ZodString>;
id: ZodNumber;
lang: ZodOptional<ZodString>;
name: ZodString;
pitch: ZodOptional<ZodNumber>;
rate: ZodOptional<ZodNumber>;
service: ZodOptional<ZodEnum&lt;{
g1: "g1";
g2: "g2";
g3: "g3";
g5: "g5";
gwn: "gwn";
msv: "msv";
oai: "oai";
}>>;
timerSpeed: ZodOptional<ZodNumber>;
voiceName: ZodOptional<ZodString>;
volume: ZodOptional<ZodNumber>;
}, $strip>;

Defined in: src/schemas/voice.ts:51

Low-level system voice mapping Represents the actual TTS voice configuration


const TextFeatureSchema: ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
text: ZodDefault<ZodNullable<ZodString>>;
}, $strip>;

Defined in: src/schemas/website.ts:24

Feature toggle with optional custom text (speakInactivity, speakEndPage, exitIntent).


const ToggleFeatureSchema: ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
}, $strip>;

Defined in: src/schemas/website.ts:32

Simple on/off feature toggle without custom text (speakSelectedText, speakLinks, etc.).


const TRANSPORT_MODES: ("chunks" | "stream" | "websocket")[] = TransportModeSchema.options;

Defined in: src/schemas/core.ts:165

Valid transport mode values for runtime validation


const TransportModeSchema: ZodEnum&lt;{
chunks: "chunks";
stream: "stream";
websocket: "websocket";
}>;

Defined in: src/schemas/core.ts:157

Audio transport mode for fallback (HTTP) voices.

  • 'chunks' (default): full download per text chunk, then play
  • 'stream': HTTP audio streaming with MSE progressive playback
  • 'websocket': persistent WebSocket connection with MSE progressive playback

const TTS_SERVICES: ("g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai")[] = TTSServiceSchema.options;

Defined in: src/schemas/core.ts:59

Valid TTS service values for runtime validation


const TTSServiceSchema: ZodEnum&lt;{
g1: "g1";
g2: "g2";
g3: "g3";
g5: "g5";
gwn: "gwn";
msv: "msv";
oai: "oai";
}>;

Defined in: src/schemas/core.ts:51

Available TTS service backends

  • g1: Primary fallback service
  • g2: Secondary fallback service
  • g3: Male voice fallbacks
  • g5: Specialty languages (Armenian, Esperanto, Macedonian, Welsh)
  • gwn: Google Cloud WaveNet (premium, requires BYOK credentials)
  • msv: Microsoft Azure Speech (premium, requires BYOK credentials)
  • oai: OpenAI TTS (premium, requires BYOK credentials)

const VERSION: string;

Defined in: src/version.ts:14

Package version, the source of truth for the OpenAPI contract version.


const VOICE_GENDERS: ("male" | "female")[] = VoiceGenderSchema.options;

Defined in: src/schemas/core.ts:29

Valid voice gender values for runtime validation


const VOICE_GENDERS_SHORT: ("f" | "m")[] = VoiceGenderShortSchema.options;

Defined in: src/schemas/core.ts:39

Valid short gender values for runtime validation


const VoiceCollectionSchema: ZodObject&lt;{
lastUpdated: ZodString;
systemVoices: ZodArray<ZodObject&lt;{
deprecated: ZodOptional<ZodBoolean>;
fallbackVoice: ZodOptional<ZodBoolean>;
gender: ZodOptional<ZodString>;
id: ZodNumber;
lang: ZodOptional<ZodString>;
name: ZodString;
pitch: ZodOptional<ZodNumber>;
rate: ZodOptional<ZodNumber>;
service: ZodOptional<ZodEnum&lt;{
g1: "g1";
g2: "g2";
g3: "g3";
g5: "g5";
gwn: "gwn";
msv: "msv";
oai: "oai";
}>>;
timerSpeed: ZodOptional<ZodNumber>;
voiceName: ZodOptional<ZodString>;
volume: ZodOptional<ZodNumber>;
}, $strip>>;
version: ZodString;
voices: ZodArray<ZodObject&lt;{
deprecated: ZodOptional<ZodBoolean>;
flag: ZodString;
gender: ZodEnum&lt;{
f: "f";
m: "m";
}>;
isByok: ZodOptional<ZodBoolean>;
lang: ZodString;
name: ZodString;
provider: ZodOptional<ZodString>;
voiceIDs: ZodArray<ZodNumber>;
}, $strip>>;
}, $strip>;

Defined in: src/schemas/voice.ts:96

Complete voice collection containing all voices


const VoiceDetailLinksSchema: ZodObject&lt;{
byLanguage: ZodObject&lt;{
href: ZodString;
}, $strip>;
collection: ZodObject&lt;{
href: ZodString;
}, $strip>;
self: ZodObject&lt;{
href: ZodString;
}, $strip>;
stream:websocket: ZodObject&lt;{
href: ZodString;
message: ZodObject&lt;{
lang: ZodOptional<ZodString>;
type: ZodString;
voice: ZodString;
}, $strip>;
premium: ZodBoolean;
protocol: ZodLiteral&lt;"websocket">;
}, $strip>;
synthesize: ZodObject&lt;{
body: ZodObject&lt;{
lang: ZodOptional<ZodString>;
voice: ZodString;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
}, $strip>;
synthesize:stream: ZodObject&lt;{
accept: ZodLiteral&lt;"text/event-stream">;
body: ZodObject&lt;{
lang: ZodOptional<ZodString>;
stream: ZodBoolean;
voice: ZodString;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
premium: ZodBoolean;
}, $strip>;
}, $strip>;

Defined in: src/schemas/responses.ts:211

Voice-detail HATEOAS links: voice-level links plus navigation back to the collection and the by-language list (only present on GET /v2/voices/{name}).


const VoiceDetailResponseSchema: ZodObject&lt;{
_links: ZodObject&lt;{
byLanguage: ZodObject&lt;{
href: ZodString;
}, $strip>;
collection: ZodObject&lt;{
href: ZodString;
}, $strip>;
self: ZodObject&lt;{
href: ZodString;
}, $strip>;
stream:websocket: ZodObject&lt;{
href: ZodString;
message: ZodObject&lt;{
lang: ZodOptional<ZodString>;
type: ZodString;
voice: ZodString;
}, $strip>;
premium: ZodBoolean;
protocol: ZodLiteral&lt;"websocket">;
}, $strip>;
synthesize: ZodObject&lt;{
body: ZodObject&lt;{
lang: ZodOptional<ZodString>;
voice: ZodString;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
}, $strip>;
synthesize:stream: ZodObject&lt;{
accept: ZodLiteral&lt;"text/event-stream">;
body: ZodObject&lt;{
lang: ZodOptional<ZodString>;
stream: ZodBoolean;
voice: ZodString;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
premium: ZodBoolean;
}, $strip>;
}, $strip>;
voice: ZodObject&lt;{
deprecated: ZodOptional<ZodBoolean>;
flag: ZodString;
gender: ZodEnum&lt;{
f: "f";
m: "m";
}>;
isByok: ZodOptional<ZodBoolean>;
lang: ZodString;
name: ZodString;
provider: ZodOptional<ZodString>;
voiceIDs: ZodArray<ZodNumber>;
}, $strip>;
}, $strip>;

Defined in: src/schemas/responses.ts:292

Response body for GET /v2/voices/{name}.


const VoiceGenderSchema: ZodEnum&lt;{
female: "female";
male: "male";
}>;

Defined in: src/schemas/core.ts:21

Voice gender classification


const VoiceGenderShortSchema: ZodEnum&lt;{
f: "f";
m: "m";
}>;

Defined in: src/schemas/core.ts:34

Short form gender used internally


const VoiceLinksSchema: ZodObject&lt;{
self: ZodObject&lt;{
href: ZodString;
}, $strip>;
stream:websocket: ZodObject&lt;{
href: ZodString;
message: ZodObject&lt;{
lang: ZodOptional<ZodString>;
type: ZodString;
voice: ZodString;
}, $strip>;
premium: ZodBoolean;
protocol: ZodLiteral&lt;"websocket">;
}, $strip>;
synthesize: ZodObject&lt;{
body: ZodObject&lt;{
lang: ZodOptional<ZodString>;
voice: ZodString;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
}, $strip>;
synthesize:stream: ZodObject&lt;{
accept: ZodLiteral&lt;"text/event-stream">;
body: ZodObject&lt;{
lang: ZodOptional<ZodString>;
stream: ZodBoolean;
voice: ZodString;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
premium: ZodBoolean;
}, $strip>;
}, $strip>;

Defined in: src/schemas/responses.ts:196

Voice-level HATEOAS links present on every voice in an API response.


const VoiceQuerySchema: ZodObject&lt;{
gender: ZodOptional<ZodEnum&lt;{
f: "f";
female: "female";
m: "m";
male: "male";
}>>;
isByok: ZodOptional<ZodBoolean>;
lang: ZodOptional<ZodString>;
name: ZodOptional<ZodString>;
provider: ZodOptional<ZodString>;
}, $strip>;

Defined in: src/schemas/voice-query.ts:26

Declarative voice selection query. All conditions are AND — a voice must match every specified field.

// Select Portuguese female voice
{ lang: "pt", gender: "female" }
// Select a specific BYOK WaveNet voice
{ lang: "en-GB", gender: "m", provider: "Google Cloud WaveNet", name: "Wavenet-A" }

const VoiceReportRequestSchema: ZodObject&lt;{
platform: ZodObject&lt;{
browser: ZodString;
browserVersion: ZodString;
deviceType: ZodOptional<ZodEnum&lt;{
desktop: "desktop";
mobile: "mobile";
tablet: "tablet";
}>>;
os: ZodString;
osVersion: ZodString;
}, $strip>;
sdkVersion: ZodOptional<ZodString>;
timestamp: ZodISODateTime;
voices: ZodArray<ZodObject&lt;{
default: ZodOptional<ZodBoolean>;
lang: ZodString;
localService: ZodBoolean;
name: ZodString;
voiceURI: ZodString;
}, $strip>>;
}, $strip>;

Defined in: src/schemas/responses.ts:72

Voice report request - sent by client to report available browser voices


const VoiceReportResponseSchema: ZodObject&lt;{
count: ZodNumber;
systemVoices: ZodArray<ZodObject&lt;{
deprecated: ZodOptional<ZodBoolean>;
fallbackVoice: ZodOptional<ZodBoolean>;
gender: ZodOptional<ZodString>;
id: ZodNumber;
lang: ZodOptional<ZodString>;
name: ZodString;
pitch: ZodOptional<ZodNumber>;
rate: ZodOptional<ZodNumber>;
service: ZodOptional<ZodEnum&lt;{
g1: "g1";
g2: "g2";
g3: "g3";
g5: "g5";
gwn: "gwn";
msv: "msv";
oai: "oai";
}>>;
timerSpeed: ZodOptional<ZodNumber>;
voiceName: ZodOptional<ZodString>;
volume: ZodOptional<ZodNumber>;
}, $strip>>;
voices: ZodArray<ZodObject&lt;{
deprecated: ZodOptional<ZodBoolean>;
flag: ZodString;
gender: ZodEnum&lt;{
f: "f";
m: "m";
}>;
isByok: ZodOptional<ZodBoolean>;
lang: ZodString;
name: ZodString;
provider: ZodOptional<ZodString>;
voiceIDs: ZodArray<ZodNumber>;
}, $strip>>;
}, $strip>;

Defined in: src/schemas/responses.ts:93

Voice report response - returns personalized voice collection


const VoicesByLanguageResponseSchema: ZodObject&lt;{
_links: ZodObject&lt;{
allVoices: ZodObject&lt;{
href: ZodString;
}, $strip>;
self: ZodObject&lt;{
href: ZodString;
}, $strip>;
}, $strip>;
count: ZodNumber;
language: ZodString;
voices: ZodArray<ZodObject&lt;{
_links: ZodObject&lt;{
self: ZodObject&lt;{
href: ZodString;
}, $strip>;
stream:websocket: ZodObject&lt;{
href: ZodString;
message: ZodObject&lt;{
lang: ...;
type: ...;
voice: ...;
}, $strip>;
premium: ZodBoolean;
protocol: ZodLiteral&lt;"websocket">;
}, $strip>;
synthesize: ZodObject&lt;{
body: ZodObject&lt;{
lang: ...;
voice: ...;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
}, $strip>;
synthesize:stream: ZodObject&lt;{
accept: ZodLiteral&lt;"text/event-stream">;
body: ZodObject&lt;{
lang: ...;
stream: ...;
voice: ...;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
premium: ZodBoolean;
}, $strip>;
}, $strip>;
deprecated: ZodOptional<ZodBoolean>;
flag: ZodString;
gender: ZodEnum&lt;{
f: "f";
m: "m";
}>;
isByok: ZodOptional<ZodBoolean>;
lang: ZodString;
name: ZodString;
provider: ZodOptional<ZodString>;
voiceIDs: ZodArray<ZodNumber>;
}, $strip>>;
}, $strip>;

Defined in: src/schemas/responses.ts:277

Response body for GET /v2/voices/by-language/{lang}.


const VoiceSchema: ZodObject&lt;{
deprecated: ZodOptional<ZodBoolean>;
flag: ZodString;
gender: ZodEnum&lt;{
f: "f";
m: "m";
}>;
isByok: ZodOptional<ZodBoolean>;
lang: ZodString;
name: ZodString;
provider: ZodOptional<ZodString>;
voiceIDs: ZodArray<ZodNumber>;
}, $strip>;

Defined in: src/schemas/voice.ts:17

High-level ResponsiveVoice voice definition Represents a user-facing voice option


const VoiceSelectorSchema: ZodPreprocess<ZodUnion<readonly [ZodString, ZodObject&lt;{
flags: ZodOptional<ZodString>;
regex: ZodString;
}, $strip>, ZodObject&lt;{
gender: ZodOptional<ZodEnum&lt;{
f: "f";
female: "female";
m: "m";
male: "male";
}>>;
isByok: ZodOptional<ZodBoolean>;
lang: ZodOptional<ZodString>;
name: ZodOptional<ZodString>;
provider: ZodOptional<ZodString>;
}, $strip>]>>;

Defined in: src/schemas/voice-query.ts:76

Voice selector — declarative grammar for choosing a voice. Three forms after parsing, all JSON-serializable so the same shape works in JS, every SDK language, and server payloads:

  • string — exact name match (e.g. 'UK English Female').
  • VoiceQuery — structured AND-filter (e.g. { lang: 'pt', gender: 'female' }).
  • RegexSelector{ regex, flags? } for pattern matching.

In JS the schema also accepts a real RegExp as input — a preprocess step normalizes it to the RegexSelector literal form before validation, so the post-parse output is always JSON-clean. The OpenAPI emit only describes the three wire forms (the preprocess is invisible to the schema description), so non-JS SDK consumers get a clean oneOf without a phantom RegExp branch.


const VoicesListResponseSchema: ZodObject&lt;{
_links: ZodObject&lt;{
self: ZodObject&lt;{
href: ZodString;
}, $strip>;
}, $strip>;
count: ZodNumber;
systemVoices: ZodArray<ZodObject&lt;{
deprecated: ZodOptional<ZodBoolean>;
fallbackVoice: ZodOptional<ZodBoolean>;
gender: ZodOptional<ZodString>;
id: ZodNumber;
lang: ZodOptional<ZodString>;
name: ZodString;
pitch: ZodOptional<ZodNumber>;
rate: ZodOptional<ZodNumber>;
service: ZodOptional<ZodEnum&lt;{
g1: "g1";
g2: "g2";
g3: "g3";
g5: "g5";
gwn: "gwn";
msv: "msv";
oai: "oai";
}>>;
timerSpeed: ZodOptional<ZodNumber>;
voiceName: ZodOptional<ZodString>;
volume: ZodOptional<ZodNumber>;
}, $strip>>;
voices: ZodArray<ZodObject&lt;{
_links: ZodObject&lt;{
self: ZodObject&lt;{
href: ZodString;
}, $strip>;
stream:websocket: ZodObject&lt;{
href: ZodString;
message: ZodObject&lt;{
lang: ...;
type: ...;
voice: ...;
}, $strip>;
premium: ZodBoolean;
protocol: ZodLiteral&lt;"websocket">;
}, $strip>;
synthesize: ZodObject&lt;{
body: ZodObject&lt;{
lang: ...;
voice: ...;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
}, $strip>;
synthesize:stream: ZodObject&lt;{
accept: ZodLiteral&lt;"text/event-stream">;
body: ZodObject&lt;{
lang: ...;
stream: ...;
voice: ...;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
premium: ZodBoolean;
}, $strip>;
}, $strip>;
deprecated: ZodOptional<ZodBoolean>;
flag: ZodString;
gender: ZodEnum&lt;{
f: "f";
m: "m";
}>;
isByok: ZodOptional<ZodBoolean>;
lang: ZodString;
name: ZodString;
provider: ZodOptional<ZodString>;
voiceIDs: ZodArray<ZodNumber>;
}, $strip>>;
}, $strip>;

Defined in: src/schemas/responses.ts:262

Response body for GET /v2/voices.


const VoiceWithLinksSchema: ZodObject&lt;{
_links: ZodObject&lt;{
self: ZodObject&lt;{
href: ZodString;
}, $strip>;
stream:websocket: ZodObject&lt;{
href: ZodString;
message: ZodObject&lt;{
lang: ZodOptional<ZodString>;
type: ZodString;
voice: ZodString;
}, $strip>;
premium: ZodBoolean;
protocol: ZodLiteral&lt;"websocket">;
}, $strip>;
synthesize: ZodObject&lt;{
body: ZodObject&lt;{
lang: ZodOptional<ZodString>;
voice: ZodString;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
}, $strip>;
synthesize:stream: ZodObject&lt;{
accept: ZodLiteral&lt;"text/event-stream">;
body: ZodObject&lt;{
lang: ZodOptional<ZodString>;
stream: ZodBoolean;
voice: ZodString;
}, $strip>;
href: ZodString;
method: ZodLiteral&lt;"POST">;
premium: ZodBoolean;
}, $strip>;
}, $strip>;
deprecated: ZodOptional<ZodBoolean>;
flag: ZodString;
gender: ZodEnum&lt;{
f: "f";
m: "m";
}>;
isByok: ZodOptional<ZodBoolean>;
lang: ZodString;
name: ZodString;
provider: ZodOptional<ZodString>;
voiceIDs: ZodArray<ZodNumber>;
}, $strip>;

Defined in: src/schemas/responses.ts:247

Voice resource as returned by API endpoints — core voice fields plus HATEOAS links.


const VolumeSchema: ZodNumber;

Defined in: src/schemas/synthesis.ts:30

Volume range (0–1; 1 = full).


const WebPlayerControlsSchema: ZodObject&lt;{
brand: ZodDefault<ZodBoolean>;
progress: ZodDefault<ZodBoolean>;
skip: ZodDefault<ZodBoolean>;
speed: ZodDefault<ZodBoolean>;
time: ZodDefault<ZodBoolean>;
}, $strip>;

Defined in: src/schemas/website.ts:83

Toggles for the player's in-line controls. The play / pause button is always shown — without it the widget is not a player. skip pairs the skip-back and skip-forward buttons together because hiding one but not the other looks visually broken in the reference design.


const WebPlayerFeatureSchema: ZodObject&lt;{
controls: ZodDefault<ZodObject&lt;{
brand: ZodDefault<ZodBoolean>;
progress: ZodDefault<ZodBoolean>;
skip: ZodDefault<ZodBoolean>;
speed: ZodDefault<ZodBoolean>;
time: ZodDefault<ZodBoolean>;
}, $strip>>;
enabled: ZodDefault<ZodBoolean>;
layout: ZodDefault<ZodObject&lt;{
display: ZodDefault<ZodEnum&lt;{
block: "block";
inline: "inline";
}>>;
mode: ZodDefault<ZodEnum&lt;{
fill: "fill";
shrink: "shrink";
}>>;
}, $strip>>;
miniPlayer: ZodDefault<ZodPreprocess<ZodObject&lt;{
animation: ZodDefault<ZodEnum&lt;{
fade: "fade";
none: "none";
pop: "pop";
slide: "slide";
}>>;
enabled: ZodDefault<ZodBoolean>;
position: ZodDefault<ZodUnion<readonly [ZodEnum&lt;{
bottom-left: ...;
bottom-right: ...;
top-left: ...;
top-right: ...;
}>, ZodObject&lt;{
bottom: ...;
left: ...;
right: ...;
top: ...;
}, $strip>]>>;
}, $strip>>>;
navigation: ZodDefault<ZodObject&lt;{
paragraphClick: ZodDefault<ZodBoolean>;
paragraphHighlight: ZodDefault<ZodBoolean>;
}, $strip>>;
paragraphSelector: ZodDefault<ZodString>;
pitch: ZodOptional<ZodNumber>;
position: ZodDefault<ZodUnion<readonly [ZodEnum&lt;{
after: "after";
before: "before";
inline: "inline";
}>, ZodObject&lt;{
at: ZodDefault<ZodEnum&lt;{
after: "after";
before: "before";
inside: "inside";
}>>;
target: ZodString;
}, $strip>]>>;
rate: ZodOptional<ZodNumber>;
sanitize: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
exclude: ZodDefault<ZodArray<ZodString>>;
}, $strip>>;
selector: ZodDefault<ZodString>;
theme: ZodDefault<ZodUnion<readonly [ZodEnum&lt;{
neutral: "neutral";
responsivevoice: "responsivevoice";
}>, ZodObject&lt;{
accent: ZodOptional<ZodString>;
accentSoft: ZodOptional<ZodString>;
bg: ZodOptional<ZodString>;
border: ZodOptional<ZodString>;
fg: ZodOptional<ZodString>;
fill: ZodOptional<ZodString>;
hover: ZodOptional<ZodString>;
muted: ZodOptional<ZodString>;
track: ZodOptional<ZodString>;
}, $strip>]>>;
voice: ZodOptional<ZodPreprocess<ZodUnion<readonly [ZodString, ZodObject&lt;{
flags: ZodOptional<ZodString>;
regex: ZodString;
}, $strip>, ZodObject&lt;{
gender: ZodOptional<ZodEnum&lt;{
f: ...;
female: ...;
m: ...;
male: ...;
}>>;
isByok: ZodOptional<ZodBoolean>;
lang: ZodOptional<ZodString>;
name: ZodOptional<ZodString>;
provider: ZodOptional<ZodString>;
}, $strip>]>>>;
volume: ZodOptional<ZodNumber>;
}, $strip>;

Defined in: src/schemas/website.ts:211

Web player feature — an article-scoped player with paragraph highlighting, click-to-jump navigation, and a floating mini-player that appears when the main player scrolls out of view.

Per-player playback overrides (voice, rate, pitch, volume) mirror the arguments of core.speak(text, voice, params). Each is optional and leaf-merges over the website default voice profile from WebsiteVoiceSchema.


const WebPlayerLayoutSchema: ZodObject&lt;{
display: ZodDefault<ZodEnum&lt;{
block: "block";
inline: "inline";
}>>;
mode: ZodDefault<ZodEnum&lt;{
fill: "fill";
shrink: "shrink";
}>>;
}, $strip>;

Defined in: src/schemas/website.ts:178

Player layout — width and how the main pill sits on the page. Defaults to shrink + block (player sized to its content, on its own line), which is the safe choice for arbitrary host pages. Use fill + inline to reproduce a full-width player that flows with surrounding text.


const WebPlayerNavigationSchema: ZodObject&lt;{
paragraphClick: ZodDefault<ZodBoolean>;
paragraphHighlight: ZodDefault<ZodBoolean>;
}, $strip>;

Defined in: src/schemas/website.ts:105

Toggles for article-level interactions. paragraphHighlight is the visual "currently playing" indicator on each paragraph; paragraphClick is click-to-jump navigation. They are independent — highlight-only without click is "follow along, no skipping ahead"; click-only without highlight is unusual but valid.


const WebPlayerSanitizeSchema: ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
exclude: ZodDefault<ZodArray<ZodString>>;
}, $strip>;

Defined in: src/schemas/website.ts:192

Narration text sanitization. When enabled, non-rendered nodes (script/style), interactive controls, embedded media, and hidden content are excluded from narrated text; false narrates raw text.


const WebPlayerThemeSchema: ZodUnion<readonly [ZodEnum&lt;{
neutral: "neutral";
responsivevoice: "responsivevoice";
}>, ZodObject&lt;{
accent: ZodOptional<ZodString>;
accentSoft: ZodOptional<ZodString>;
bg: ZodOptional<ZodString>;
border: ZodOptional<ZodString>;
fg: ZodOptional<ZodString>;
fill: ZodOptional<ZodString>;
hover: ZodOptional<ZodString>;
muted: ZodOptional<ZodString>;
track: ZodOptional<ZodString>;
}, $strip>]>;

Defined in: src/schemas/website.ts:70

Theme input — either a preset name or a partial token record merged over the neutral baseline.


const WebPlayerThemeTokensSchema: ZodObject&lt;{
accent: ZodOptional<ZodString>;
accentSoft: ZodOptional<ZodString>;
bg: ZodOptional<ZodString>;
border: ZodOptional<ZodString>;
fg: ZodOptional<ZodString>;
fill: ZodOptional<ZodString>;
hover: ZodOptional<ZodString>;
muted: ZodOptional<ZodString>;
track: ZodOptional<ZodString>;
}, $strip>;

Defined in: src/schemas/website.ts:43

Colour tokens that drive the web player's appearance. Each value is a CSS colour string. Applied as CSS custom properties on the player and the article container so paragraph styles inherit them.


const WebsiteAnalyticsSchema: ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
}, $strip>;

Defined in: src/schemas/website.ts:342

Analytics configuration.


const WebsiteConfigResponseSchema: ZodObject&lt;{
analytics: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
}, $strip>>;
auth: ZodOptional<ZodObject&lt;{
exp: ZodNumber;
token: ZodString;
}, $strip>>;
features: ZodDefault<ZodObject&lt;{
accessibilityNavigation: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
}, $strip>>;
exitIntent: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
text: ZodDefault<ZodNullable<ZodString>>;
}, $strip>>;
paragraphNavigation: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
}, $strip>>;
speakEndPage: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
text: ZodDefault<ZodNullable<ZodString>>;
}, $strip>>;
speakInactivity: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
text: ZodDefault<ZodNullable<ZodString>>;
}, $strip>>;
speakLinks: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
}, $strip>>;
speakSelectedText: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
}, $strip>>;
webPlayer: ZodDefault<ZodObject&lt;{
controls: ZodDefault<ZodObject&lt;{
brand: ...;
progress: ...;
skip: ...;
speed: ...;
time: ...;
}, $strip>>;
enabled: ZodDefault<ZodBoolean>;
layout: ZodDefault<ZodObject&lt;{
display: ...;
mode: ...;
}, $strip>>;
miniPlayer: ZodDefault<ZodPreprocess<ZodObject&lt;..., ...>>>;
navigation: ZodDefault<ZodObject&lt;{
paragraphClick: ...;
paragraphHighlight: ...;
}, $strip>>;
paragraphSelector: ZodDefault<ZodString>;
pitch: ZodOptional<ZodNumber>;
position: ZodDefault<ZodUnion<readonly [..., ...]>>;
rate: ZodOptional<ZodNumber>;
sanitize: ZodDefault<ZodObject&lt;{
enabled: ...;
exclude: ...;
}, $strip>>;
selector: ZodDefault<ZodString>;
theme: ZodDefault<ZodUnion<readonly [..., ...]>>;
voice: ZodOptional<ZodPreprocess<ZodUnion&lt;...>>>;
volume: ZodOptional<ZodNumber>;
}, $strip>>;
welcomeMessage: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
text: ZodDefault<ZodNullable<ZodString>>;
}, $strip>>;
welcomeMessageOnce: ZodDefault<ZodBoolean>;
}, $strip>>;
voice: ZodDefault<ZodObject&lt;{
name: ZodDefault<ZodString>;
pitch: ZodDefault<ZodNumber>;
rate: ZodDefault<ZodNumber>;
volume: ZodDefault<ZodNumber>;
}, $strip>>;
}, $strip>;

Defined in: src/schemas/website.ts:366

Full website config response from GET /v2/config.


const WebsiteFeaturesSchema: ZodObject&lt;{
accessibilityNavigation: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
}, $strip>>;
exitIntent: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
text: ZodDefault<ZodNullable<ZodString>>;
}, $strip>>;
paragraphNavigation: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
}, $strip>>;
speakEndPage: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
text: ZodDefault<ZodNullable<ZodString>>;
}, $strip>>;
speakInactivity: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
text: ZodDefault<ZodNullable<ZodString>>;
}, $strip>>;
speakLinks: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
}, $strip>>;
speakSelectedText: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
}, $strip>>;
webPlayer: ZodDefault<ZodObject&lt;{
controls: ZodDefault<ZodObject&lt;{
brand: ZodDefault<ZodBoolean>;
progress: ZodDefault<ZodBoolean>;
skip: ZodDefault<ZodBoolean>;
speed: ZodDefault<ZodBoolean>;
time: ZodDefault<ZodBoolean>;
}, $strip>>;
enabled: ZodDefault<ZodBoolean>;
layout: ZodDefault<ZodObject&lt;{
display: ZodDefault<ZodEnum&lt;{
block: ...;
inline: ...;
}>>;
mode: ZodDefault<ZodEnum&lt;{
fill: ...;
shrink: ...;
}>>;
}, $strip>>;
miniPlayer: ZodDefault<ZodPreprocess<ZodObject&lt;{
animation: ZodDefault<ZodEnum&lt;...>>;
enabled: ZodDefault<ZodBoolean>;
position: ZodDefault<ZodUnion&lt;...>>;
}, $strip>>>;
navigation: ZodDefault<ZodObject&lt;{
paragraphClick: ZodDefault<ZodBoolean>;
paragraphHighlight: ZodDefault<ZodBoolean>;
}, $strip>>;
paragraphSelector: ZodDefault<ZodString>;
pitch: ZodOptional<ZodNumber>;
position: ZodDefault<ZodUnion<readonly [ZodEnum&lt;{
after: "after";
before: "before";
inline: "inline";
}>, ZodObject&lt;{
at: ZodDefault&lt;...>;
target: ZodString;
}, $strip>]>>;
rate: ZodOptional<ZodNumber>;
sanitize: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
exclude: ZodDefault<ZodArray<ZodString>>;
}, $strip>>;
selector: ZodDefault<ZodString>;
theme: ZodDefault<ZodUnion<readonly [ZodEnum&lt;{
neutral: "neutral";
responsivevoice: "responsivevoice";
}>, ZodObject&lt;{
accent: ZodOptional&lt;...>;
accentSoft: ZodOptional&lt;...>;
bg: ZodOptional&lt;...>;
border: ZodOptional&lt;...>;
fg: ZodOptional&lt;...>;
fill: ZodOptional&lt;...>;
hover: ZodOptional&lt;...>;
muted: ZodOptional&lt;...>;
track: ZodOptional&lt;...>;
}, $strip>]>>;
voice: ZodOptional<ZodPreprocess<ZodUnion<readonly [ZodString, ZodObject&lt;{
flags: ...;
regex: ...;
}, $strip>, ZodObject&lt;{
gender: ...;
isByok: ...;
lang: ...;
name: ...;
provider: ...;
}, $strip>]>>>;
volume: ZodOptional<ZodNumber>;
}, $strip>>;
welcomeMessage: ZodDefault<ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
text: ZodDefault<ZodNullable<ZodString>>;
}, $strip>>;
welcomeMessageOnce: ZodDefault<ZodBoolean>;
}, $strip>;

Defined in: src/schemas/website.ts:306

Aggregated per-website feature flags returned by GET /v2/config.


const WebsiteVoiceSchema: ZodObject&lt;{
name: ZodDefault<ZodString>;
pitch: ZodDefault<ZodNumber>;
rate: ZodDefault<ZodNumber>;
volume: ZodDefault<ZodNumber>;
}, $strip>;

Defined in: src/schemas/website.ts:330

Voice profile from the dashboard — curated subset of voice_profiles table.


const WelcomeMessageFeatureSchema: ZodObject&lt;{
enabled: ZodDefault<ZodBoolean>;
text: ZodDefault<ZodNullable<ZodString>>;
}, $strip>;

Defined in: src/schemas/website.ts:16

Per-feature configuration. Each feature has enabled and optional text/settings.

function formatProsodyApplied(knobs): string;

Defined in: src/schemas/prosody.ts:53

Format a set/iterable of knobs into the comma-separated header value. Output order follows PROSODY_KNOBS so two calls with the same inputs produce byte-identical headers (cache-key friendly).

ParameterType
knobsIterable&lt;"pitch" | "rate" | "volume">

string


function getDefaultFormat(engine): "mp3" | "ogg" | "wav";

Defined in: src/schemas/core.ts:119

Get the default audio format for a TTS engine.

ParameterType
engine"g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai"

"mp3" | "ogg" | "wav"


function isAudioFormat(value): value is "mp3" | "ogg" | "wav";

Defined in: src/guards.ts:65

Check if a value is a valid audio format

ParameterType
valueunknown

value is "mp3" | "ogg" | "wav"


function isBrowserVoiceInfo(value): value is { default?: boolean; lang: string; localService: boolean; name: string; voiceURI: string };

Defined in: src/guards.ts:157

Check if a value is a valid BrowserVoiceInfo object

ParameterTypeDescription
valueunknownThe value to check

value is { default?: boolean; lang: string; localService: boolean; name: string; voiceURI: string }

True if the value is a valid BrowserVoiceInfo object


function isFormatSupportedByEngine(engine, format): boolean;

Defined in: src/schemas/core.ts:111

Check whether a given audio format is supported by a TTS engine.

ParameterType
engine"g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai"
format"mp3" | "ogg" | "wav"

boolean


function isPlatformReport(value): value is { browser: string; browserVersion: string; deviceType?: "desktop" | "mobile" | "tablet"; os: string; osVersion: string };

Defined in: src/guards.ts:166

Check if a value is a valid PlatformReport object

ParameterTypeDescription
valueunknownThe value to check

value is { browser: string; browserVersion: string; deviceType?: "desktop" | "mobile" | "tablet"; os: string; osVersion: string }

True if the value is a valid PlatformReport object


function isRVErrorEvent(value): value is { code?: string; message: string; timestamp: number; type: "OnError" };

Defined in: src/guards.ts:135

Check if a value is a valid RVErrorEvent object

ParameterTypeDescription
valueunknownThe value to check

value is { code?: string; message: string; timestamp: number; type: "OnError" }

True if the value is a valid RVErrorEvent object


function isRVEvent(value): value is { timestamp: number; type: "OnLoad" | "OnReady" | "OnStart" | "OnEnd" | "OnError" | "OnPause" | "OnResume" | "OnServiceSwitched" | "OnClickEvent" | "OnAllowSpeechClicked" | "OnPartStart" | "OnPartEnd" | "OnVoiceResolved" };

Defined in: src/guards.ts:126

Check if a value is a valid RVEvent object

ParameterTypeDescription
valueunknownThe value to check

value is { timestamp: number; type: "OnLoad" | "OnReady" | "OnStart" | "OnEnd" | "OnError" | "OnPause" | "OnResume" | "OnServiceSwitched" | "OnClickEvent" | "OnAllowSpeechClicked" | "OnPartStart" | "OnPartEnd" | "OnVoiceResolved" }

True if the value is a valid RVEvent object


function isRVEventType(value): value is "OnLoad" | "OnReady" | "OnStart" | "OnEnd" | "OnError" | "OnPause" | "OnResume" | "OnServiceSwitched" | "OnClickEvent" | "OnAllowSpeechClicked" | "OnPartStart" | "OnPartEnd" | "OnVoiceResolved";

Defined in: src/guards.ts:86

Check if a value is a valid event type

ParameterType
valueunknown

value is "OnLoad" | "OnReady" | "OnStart" | "OnEnd" | "OnError" | "OnPause" | "OnResume" | "OnServiceSwitched" | "OnClickEvent" | "OnAllowSpeechClicked" | "OnPartStart" | "OnPartEnd" | "OnVoiceResolved"


function isRVServiceSwitchedEvent(value): value is { from: "g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai" | "native"; timestamp: number; to: "g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai" | "native"; type: "OnServiceSwitched" };

Defined in: src/guards.ts:144

Check if a value is a valid RVServiceSwitchedEvent object

ParameterTypeDescription
valueunknownThe value to check

value is { from: "g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai" | "native"; timestamp: number; to: "g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai" | "native"; type: "OnServiceSwitched" }

True if the value is a valid RVServiceSwitchedEvent object


function isSynthesizeRequest(value): value is { engine?: "g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai"; format?: "mp3" | "ogg" | "wav"; gender?: "male" | "female"; lang?: string; name?: string; pitch?: number; rate?: number; text: string; voice?: string; volume?: number };

Defined in: src/guards.ts:117

Check if a value is a valid SynthesizeRequest object

ParameterTypeDescription
valueunknownThe value to check

value is { engine?: "g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai"; format?: "mp3" | "ogg" | "wav"; gender?: "male" | "female"; lang?: string; name?: string; pitch?: number; rate?: number; text: string; voice?: string; volume?: number }

True if the value is a valid SynthesizeRequest object


function isSystemVoice(value): value is { deprecated?: boolean; fallbackVoice?: boolean; gender?: string; id: number; lang?: string; name: string; pitch?: number; rate?: number; service?: "g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai"; timerSpeed?: number; voiceName?: string; volume?: number };

Defined in: src/guards.ts:108

Check if a value is a valid SystemVoice object

ParameterTypeDescription
valueunknownThe value to check

value is { deprecated?: boolean; fallbackVoice?: boolean; gender?: string; id: number; lang?: string; name: string; pitch?: number; rate?: number; service?: "g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai"; timerSpeed?: number; voiceName?: string; volume?: number }

True if the value is a valid SystemVoice object


function isTTSService(value): value is "g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai";

Defined in: src/guards.ts:58

Check if a value is a valid TTS service

ParameterType
valueunknown

value is "g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai"


function isVoice(value): value is { deprecated?: boolean; flag: string; gender: "f" | "m"; isByok?: boolean; lang: string; name: string; provider?: string; voiceIDs: number[] };

Defined in: src/guards.ts:99

Check if a value is a valid Voice object

ParameterTypeDescription
valueunknownThe value to check

value is { deprecated?: boolean; flag: string; gender: "f" | "m"; isByok?: boolean; lang: string; name: string; provider?: string; voiceIDs: number[] }

True if the value is a valid Voice object


function isVoiceGender(value): value is "male" | "female";

Defined in: src/guards.ts:72

Check if a value is a valid voice gender

ParameterType
valueunknown

value is "male" | "female"


function isVoiceGenderShort(value): value is "f" | "m";

Defined in: src/guards.ts:79

Check if a value is a valid short gender

ParameterType
valueunknown

value is "f" | "m"


function isVoiceReportRequest(value): value is { platform: { browser: string; browserVersion: string; deviceType?: "desktop" | "mobile" | "tablet"; os: string; osVersion: string }; sdkVersion?: string; timestamp: string; voices: { default?: boolean; lang: string; localService: boolean; name: string; voiceURI: string }[] };

Defined in: src/guards.ts:175

Check if a value is a valid VoiceReportRequest object

ParameterTypeDescription
valueunknownThe value to check

value is { platform: { browser: string; browserVersion: string; deviceType?: "desktop" | "mobile" | "tablet"; os: string; osVersion: string }; sdkVersion?: string; timestamp: string; voices: { default?: boolean; lang: string; localService: boolean; name: string; voiceURI: string }[] }

True if the value is a valid VoiceReportRequest object


function isVoiceReportResponse(value): value is { count: number; systemVoices: { deprecated?: boolean; fallbackVoice?: boolean; gender?: string; id: number; lang?: string; name: string; pitch?: number; rate?: number; service?: "g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai"; timerSpeed?: number; voiceName?: string; volume?: number }[]; voices: { deprecated?: boolean; flag: string; gender: "f" | "m"; isByok?: boolean; lang: string; name: string; provider?: string; voiceIDs: number[] }[] };

Defined in: src/guards.ts:184

Check if a value is a valid VoiceReportResponse object

ParameterTypeDescription
valueunknownThe value to check

value is { count: number; systemVoices: { deprecated?: boolean; fallbackVoice?: boolean; gender?: string; id: number; lang?: string; name: string; pitch?: number; rate?: number; service?: "g1" | "g2" | "g3" | "g5" | "gwn" | "msv" | "oai"; timerSpeed?: number; voiceName?: string; volume?: number }[]; voices: { deprecated?: boolean; flag: string; gender: "f" | "m"; isByok?: boolean; lang: string; name: string; provider?: string; voiceIDs: number[] }[] }

True if the value is a valid VoiceReportResponse object


function parseProsodyApplied(value): Set&lt;"pitch" | "rate" | "volume">;

Defined in: src/schemas/prosody.ts:36

Parse the RV-Prosody-Applied header value into a set of knobs. Tolerates null/undefined (legacy server, no header) and empty string (server applied nothing) by returning an empty set. Unknown tokens are dropped silently — defensive against future server additions an old client doesn't know.

ParameterType
valuestring | null | undefined

Set&lt;"pitch" | "rate" | "volume">