Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/terkelg/utters
- Owner: terkelg
- License: mit
- Created: 2020-05-25T16:40:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-29T14:50:06.000Z (3 months ago)
- Last Synced: 2024-11-10T10:41:37.587Z (about 1 month ago)
- Topics: promises, speechsynthesis, speechsynthesisutterance, text-to-speech
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
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)