voicetext-sdk
v0.1.0
Published
VoiceText Web API SDK for Node.js
Downloads
4
Readme
voicetext-sdk-nodejs
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
- Github: airRnot1106
- NPM: airrnot1106
- Twitter: @airRnot1106
LICENSE
This project is licensed under the MIT License - see the LICENSE file for details.