# cordova-plugin-bst-tts

> Cordova Text-to-Speech Plugin

Latest version **1.0.2** (published 2018-03-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-bst-tts
pnpm add cordova-plugin-bst-tts
yarn add cordova-plugin-bst-tts
bun add cordova-plugin-bst-tts
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-03-06 |
| First published | 2018-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 178 |
| Author | VILIC VANE |
| Maintainers | bossien |
| Keywords | cordova, tts, text-to-speech, ecosystem:cordova, cordova-ios, cordova-wp8, cordova-android |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-bst-tts
- Repository: https://github.com/vilic/cordova-plugin-tts
- Homepage: https://github.com/vilic/cordova-plugin-tts#readme
- Issues: https://github.com/vilic/cordova-plugin-tts/issues
- npm.io page: https://npm.io/package/cordova-plugin-bst-tts

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-03-06
- 1.0.1 — 2018-03-06
- 1.0.0 — 2018-02-01
- 0.2.3 — 2018-02-01

## README

# Cordova Text-to-Speech Plugin

## Platforms

iOS 7+  
Windows Phone 8  
Android 4.0.3+ (API Level 15+)

## Installation

```sh
cordova plugin add cordova-plugin-tts
```

## Usage

```javascript
// basic usage
TTS
    .speak('hello, world!', function () {
        alert('success');
    }, function (reason) {
        alert(reason);
    });

// or with more options
TTS
    .speak({
        text: 'hello, world!',
        locale: 'en-GB',
        rate: 0.75
    }, function () {
        alert('success');
    }, function (reason) {
        alert(reason);
    });
```

**Tips:** `speak` an empty string to interrupt.

## API Definitions

The `onfulfilled` callback will be called when the speech finishes,
and the `onrejected` callback (Windows Phone only) will be called when an error occurs.

If the API is invoked when it's still speaking, the previous speaking will be canceled immediately,
but the `onfulfilled` callback of the previous speaking will be called when it stops.

```typescript
declare module TTS {
    interface IOptions {
        /** text to speak */
        text: string;
        /** a string like 'en-US', 'zh-CN', etc */
        locale?: string;
        /** speed rate, 0 ~ 1 */
        rate?: number;
    }

    function speak(options: IOptions, onfulfilled: () => void, onrejected: (reason) => void): void;
    function speak(text: string, onfulfilled: () => void, onrejected: (reason) => void): void;
}
```

---
_Source: https://npm.io/package/cordova-plugin-bst-tts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
