voicetextlib
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

VoiceTextAPI

Converts text to speech using the VoiceText Web API.

How to use

Install

yarn add voicetextlib

Usage

stream(param = {}) -> Promise<NodeJS.ReadableStream>

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>

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.

/voicetextlib/

    Package Sidebar

    Install

    npm i voicetextlib

    Weekly Downloads

    0

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    5.89 kB

    Total Files

    7

    Last publish

    Collaborators

    • noriokun4649