# voicetextlib

> VoiceText Web API library from TypeScript.

Latest version **1.0.2** (published 2022-02-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install voicetextlib
pnpm add voicetextlib
yarn add voicetextlib
bun add voicetextlib
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-02-18 |
| First published | 2022-02-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 3 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | noriokun4649 |
| Maintainers | noriokun4649 |
| Keywords | voicetext |

## Links

- npm: https://www.npmjs.com/package/voicetextlib
- Repository: https://github.com/noriokun4649/VoiceTextAPI
- npm.io page: https://npm.io/package/voicetextlib

## Dependencies (3)

- [joi](https://npm.io/package/joi.md) ^17.6.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^3.2.0
- [querystringify](https://npm.io/package/querystringify.md) ^2.2.0

## Recent versions

- 1.0.2 (latest) — 2022-02-18
- 1.0.1 — 2022-02-18
- 1.0.0 — 2022-02-18

## README

# VoiceTextAPI
Converts text to speech using the [VoiceText Web API](https://cloud.voicetext.jp/webapi/docs/api).

# How to use
## Install
```
yarn add voicetextlib
```

## Usage
### ```stream(param = {})``` -> ```Promise<NodeJS.ReadableStream>```
```ts
import VoiceTextApi from 'voicetextlib';
import fs from 'node:fs';

const voice = new VoiceTextApi('API TOKEN');
voice.stream({text:'読み上げたい音声です',format:'wav',speaker:'haruka',speed:50})
.then((body) => body.pipe(fs.createWriteStream('test.wav')));
```
### ```fetchBuffer(param = {})``` -> ```Promise<Uint8Array>```
```ts
import VoiceTextApi from 'voicetextlib';
import fs from 'node:fs';

const voice = new VoiceTextApi('API TOKEN');
voice.fetchBuffer({text:'読み上げたい音声です',format:'wav',speaker:'haruka',speed:50})
.then((body) => fs.writeFileSync('tes3t.wav',body));
```

## Build
```
yarn run build
```

# Special Thanks
This project has been strongly influenced by the following projects.
- [59naga/voice-text](https://github.com/59naga/voice-text)

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