npm install voicetext-sdk//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); })();See document and official website.
If you find a bug or problem, please open an issue!:bug:
- Github: airRnot1106
- NPM: airrnot1106
- Twitter: @airRnot1106
This project is licensed under the MIT License - see the LICENSE file for details.