Options
All
  • Public
  • Public/Protected
  • All
Menu

voicetext-sdk

voicetext-sdk-nodejs

Build Status npm (tag) Code Climate maintainability Code Climate coverage npm

Install

npm install voicetext-sdk

Usage

//js
const { VoiceText } = require('voicetext-sdk');

//ts
import { VoiceText } from 'voicetext-sdk';

const voiceText = new VoiceText({
apiKey: '<your-api-key>',
});

voiceText
.setText('こんにちは')
.setSpeaker('takeru')
.setEmotion('happiness')
.setEmotionLevel(4)
.setFormat('mp3')
.setPitch(120)
.setSpeed(80)
.setVolume(100);

//or

const voiceText = new VoiceText({
apiKey: '<your-api-key>',
text: 'こんにちは',
speaker: 'takeru',
emotion: 'happiness',
emotionLevel: 4,
format: 'mp3',
pitch: 120,
speed: 80,
volume: 100,
});

(async () => {
const buffer = await voiceText.fetchBuffer();
const stream = await voiceText.stream();

//example of discord.js
const resource = createAudioStream(stream);
})();

API

See document and official website.

Issues

If you find a bug or problem, please open an issue!:bug:

Author

LICENSE

This project is licensed under the MIT License - see the LICENSE file for details.

Generated using TypeDoc