ionic-native
Version:
Native plugin wrappers for Cordova and Ionic with TypeScript, ES6+, Promise and Observable support
35 lines (34 loc) • 871 B
TypeScript
export interface TTSOptions {
/** text to speak */
text: string;
/** a string like 'en-US', 'zh-CN', etc */
locale?: string;
/** speed rate, 0 ~ 1 */
rate?: number;
}
/**
* @name TextToSpeech
* @description
* Text to Speech plugin
*
* @usage
* ```
* import {TextToSpeech} from 'ionic-native';
*
* TextToSpeech.speak('Hello World')
* .then(() => console.log('Success'))
* .catch((reason: any) => console.log(reason));
*
* ```
* @interfaces
* TTSOptions
*/
export declare class TextToSpeech {
/**
* This function speaks
* @param options {string | TTSOptions} Text to speak or TTSOptions
* @return {Promise<any>} Returns a promise that resolves when the speaking finishes
*/
static speak(options: string | TTSOptions): Promise<any>;
static stop(): Promise<any>;
}