Skip to content

NativeTTSConfig

Configuration options for the NativeTTS provider.

Defined in: src/providers/tts/native/NativeTTS.ts:53

Configuration options for the NativeTTS provider.

Remarks

Extends the base TTSProviderConfig with options specific to the browser’s SpeechSynthesis API, including voice selection by name or language and a preference for local (offline) voices.

Example

const config: NativeTTSConfig = {
  voiceName: 'Google US English',
  voiceLang: 'en-US',
  preferLocal: true,
  rate: 1.2,
  pitch: 0,
};

Extends

Properties

PropertyTypeDefault valueDescriptionInherited fromDefined in
apiKey?stringundefinedAPI key or authentication token for the provider. Remarks For client-side usage, consider using a proxy server to keep API keys secure. The SDK provides Express, Next.js, and Node adapters for this purpose.TTSProviderConfig.apiKeysrc/core/types/providers.ts:67
debug?booleanfalseWhether to enable debug logging for this provider. Remarks When true, the provider emits detailed internal logs. This is separate from the SDK-level LoggingConfig.TTSProviderConfig.debugsrc/core/types/providers.ts:86
endpoint?stringundefinedCustom endpoint URL to override the provider’s default API endpoint. Remarks Useful for self-hosted instances, proxy servers, or development environments.TTSProviderConfig.endpointsrc/core/types/providers.ts:75
model?stringundefinedModel to use for text-to-speech synthesis. Remarks Provider-specific model identifier (e.g., 'aura-2' for Deepgram).TTSProviderConfig.modelsrc/core/types/providers.ts:975
outputFormat?stringundefinedOutput audio format identifier. Remarks Provider-specific format string (e.g., 'linear16', 'mp3', 'opus').TTSProviderConfig.outputFormatsrc/core/types/providers.ts:1000
pitch?numberundefinedPitch adjustment in semitones. Remarks Values from -20 to +20 semitones. Not all providers support pitch adjustment.TTSProviderConfig.pitchsrc/core/types/providers.ts:992
preferLocal?booleantrueWhether to prefer locally-installed voices over network voices. Remarks Local voices are typically lower latency and work offline. When true, the provider will prefer voices where SpeechSynthesisVoice.localService is true, if no voice was matched by name or language.-src/providers/tts/native/NativeTTS.ts:86
rate?numberundefinedSpeech rate multiplier. Remarks Values from 0.25 (quarter speed) to 4.0 (quadruple speed), where 1.0 is normal speed. Not all providers support rate adjustment.TTSProviderConfig.ratesrc/core/types/providers.ts:984
sampleRate?numberundefinedSample rate for the output audio in Hz. Remarks Common values are 16000, 24000, and 48000. Must match the format capabilities of the chosen voice and model.TTSProviderConfig.sampleRatesrc/core/types/providers.ts:1009
timeout?numberundefinedRequest timeout in milliseconds. Remarks Applies to HTTP requests (REST providers) and connection establishment (WebSocket providers). Set to 0 for no timeout.TTSProviderConfig.timeoutsrc/core/types/providers.ts:95
voice?stringundefinedVoice ID or name to use for synthesis. Remarks Provider-specific voice identifier. For example, Deepgram uses identifiers like 'aura-asteria-en', while ElevenLabs uses voice IDs.TTSProviderConfig.voicesrc/core/types/providers.ts:967
voiceLang?stringundefinedBCP 47 language tag to filter available voices (e.g., 'en-US', 'fr'). Remarks Used as a fallback when no voice matches voiceName or voice. Matches voices whose lang property starts with this value.-src/providers/tts/native/NativeTTS.ts:74
voiceName?stringundefined (uses voice or falls back to 'default')Voice name or URI to select from available browser voices. Remarks Performs a case-insensitive partial match against available voice names. If no match is found, falls back to language-based or default selection.-src/providers/tts/native/NativeTTS.ts:63

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency