Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/terkelg/utters

Small (257B) promise wrapper for SpeechSynthesisUtterance
https://github.com/terkelg/utters

promises speechsynthesis speechsynthesisutterance text-to-speech

Last synced: about 1 month ago
JSON representation

Small (257B) promise wrapper for SpeechSynthesisUtterance

Awesome Lists containing this project

README

        

# Utters
> Small (257B) promise wrapper for SpeechSynthesisUtterance

## Install

```
$ npm install utters
```

This module is delivered as:

* **ES Module**: [`dist/index.mjs`](https://unpkg.com/utters/dist/index.mjs)
* **UMD**: [`dist/utters.umd.js`](https://unpkg.com/utters/dist/utters.umd.js)
* **UMD Minified**: [`dist/utters.umd.min.js`](https://unpkg.com/utters/dist/utters.umd.min.js)

## Usage

```js
import utters from 'utters';

function speak() {

// string input
await utters(`Hello World`);

// SpeechSynthesisUtterance input
await utters(new SpeechSynthesisUtterance(`Hello World`));

console.log(`Done!`);
}
```

Read more about how to use the [`SpeechSynthesis` API on MDN](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis)

## API

### utters(input)
Type: `string|SpeechSynthesisUtterance`

Returns: `Promise`

## License

MIT © [Terkel Gjervig](https://terkel.com)