js-tts-wrapper
Version:
A JavaScript/TypeScript library that provides a unified API for working with multiple cloud-based Text-to-Speech (TTS) services
43 lines (42 loc) • 1.54 kB
TypeScript
import type { SpeakOptions } from "../types";
/**
* Check if text is SSML
* @param text Text to check
* @returns True if the text is SSML
*/
export declare function isSSML(text: string): boolean;
/**
* Validate SSML for a specific engine
* @param ssml SSML text to validate
* @param engine Target TTS engine
* @param voiceId Optional voice ID for voice-specific validation
* @returns Validation result with errors and warnings
*/
export declare function validateSSMLForEngine(ssml: string, engine: string, voiceId?: string): import("./ssml-compatibility.js").SSMLValidationResult;
/**
* Process SSML for engine compatibility
* @param ssml SSML text to process
* @param engine Target TTS engine
* @param voiceId Optional voice ID for voice-specific processing
* @returns Processed SSML compatible with the target engine
*/
export declare function processSSMLForEngine(ssml: string, engine: string, voiceId?: string): string;
/**
* Strip SSML tags from text
* @param ssml SSML text
* @returns Plain text without SSML tags
*/
export declare function stripSSML(ssml: string): string;
/**
* Create a prosody tag with the given properties
* @param text Text to wrap with prosody
* @param options Speak options
* @returns SSML with prosody tag
*/
export declare function createProsodyTag(text: string, options?: SpeakOptions): string;
/**
* Wrap text with speak tags if not already present
* @param text Text to wrap
* @returns SSML with speak tags
*/
export declare function wrapWithSpeakTags(text: string): string;