import type { Talk } from '../types/voice'; import type { VoiceEngine } from './VoiceEngine'; export interface PiperPlusAssets { /** Base path where piper assets are served (e.g. '/piper/' or 'https://example.com/piper/'). Must end with '/'. */ basePath: string; /** Model config JSON filename relative to basePath + 'models/' (e.g. 'tsukuyomi-config.json') */ modelConfigFile: string; /** ONNX model filename relative to basePath + 'models/' (e.g. 'tsukuyomi-wavlm-300epoch.onnx') */ modelFile: string; /** HTS voice filename relative to basePath + 'assets/voice/' (e.g. 'mei_normal.htsvoice') */ voiceFile: string; } /** * WASM-based Japanese TTS engine powered by ONNX Runtime Web and OpenJTalk. * * This engine is intended for browser-only execution. */ export declare class PiperPlusEngine implements VoiceEngine { private phonemizer; private onnxSession; private modelConfig; private initialized; private initPromise; private assets?; private speed; private noiseScale; static isAvailable(): boolean; setAssets(assets: PiperPlusAssets): void; /** * Set the speaking speed multiplier. * * Valid range is 0.5 to 2.0. The default value is 1.0. */ setSpeed(speed?: number): void; /** * Set the synthesis noise scale. * * Valid range is 0.0 to 2.0. The default value is 1.0. */ setNoiseScale(noiseScale?: number): void; initialize(): Promise; fetchAudio(input: Talk, speaker: string, apiKey?: string): Promise; dispose(): Promise; getTestMessage(textVoiceText?: string): string; private requireAssets; private requireModelConfig; private requirePhonemizer; private requireOnnxSession; } export declare function float32ToWav(samples: Float32Array, sampleRate: number): ArrayBuffer;