https://github.com/afine970/ttspeech
A Promise tts api, it depend on browser api window.speechSynthesis
https://github.com/afine970/ttspeech
tts tts-js
Last synced: 12 months ago
JSON representation
A Promise tts api, it depend on browser api window.speechSynthesis
- Host: GitHub
- URL: https://github.com/afine970/ttspeech
- Owner: AFine970
- Created: 2023-05-24T15:07:31.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-06T08:45:37.000Z (about 3 years ago)
- Last Synced: 2025-03-12T18:48:08.369Z (over 1 year ago)
- Topics: tts, tts-js
- Language: TypeScript
- Homepage:
- Size: 230 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ttspeech
> Out-of-the-box `Promise` tts api, it depend on browser api `window.speechSynthesis`;
## Install
you can install package in your dependencies
```bash
yarn add ttspeech
# or
pnpm add ttspeech
```
## Usage
### 1. Simple usage
```ts
import { speck } from "ttspeech";
speck("hello world!");
// you can hear "hello world!"
```
### 2. Promise usage
```ts
import { speck } from "ttspeech";
(async () => {
await speck("hello world!");
window.alert("speech end~");
})();
```
## Demo
```bash
git clone https://github.com/AFine970/ttspeech.git
pnpm install
cd /packages/example && pnpm dev
```
