Glue code between node-openjtalk-binding and discordjs.
#npm
npm install node-openjtalk-binding-discordjs
#yarn
yarn add node-openjtalk-binding-discordjs
const { synthesis } = require("node-openjtalk-binding-discordjs");
const path = require("path");
const htsvoice = readFileSync(path_to_htsvoice);
/* ... */
const stream = silenceOnError(synthesis(message.content, {
htsvoice,
}),err => console.error("Stream Error:", err));
connection.play(stream, {
type: "converted"
});
const { synthesis } = require("node-openjtalk-binding-discordjs");
const path = require("path");
const htsvoice = readFileSync(path_to_htsvoice);
/* ... */
const stream = silenceOnError(synthesis(message.content, {
htsvoice,
}),err => console.error("Stream Error:", err));
const resource = createAudioResource(stream, {
inputType: StreamType.Raw,
});
player.play(resource);
Generated using TypeDoc