node-openjtalk
OpenJTalk, Japanese text-to-speech engine binding for NodeJS.
Requirements
MacOSX users do not need to install libiconv because OSX already includes it.
Installation
$ npm install node-openjtalk
Usage
var fs = ;var Speaker = ;var OpenJTalk = OpenJTalk; // pre-included HTS voice filevar fn_voice = OpenJTalkvoicesmei_normal;// instantiate OpenJTalk with an HTS voicevar open_jtalk = voice: fn_voice; // synthesize a voice buffer from a textopen_jtalk; // synthesize a voice synchronouslyvar buffer = open_jtalk; // flush to node-speakervar speaker = channels: 1 bitDepth: 16 sampleRate: 48000;speaker;
API
new OpenJTalk(option)
Instantiates OpenJTalk object.
You must specify HTS voice file path with an option argument.
var OpenJTalk = OpenJTalk;var open_jtalk = voice: "/path/to/HTS voice file";
You can use pre-included voice files.
var OpenJTalk = OpenJTalk;var open_jtalk = voice: OpenJTalkvoicesm001;
The pre-included voice files are:
- m001
- mei_angry
- mei_bashful
- mei_happy
- mei_normal
- mei_sad
OpenJTalk#synthesize(text, [optionHook], callback)
Synthesizes voice audio asynchronously from a text. The callback takes two arguments, error and buffer object.
open_jtalk;
The "optionHook" function lets you modify synthesis parameters. For example, following code makes speech speed double.
open_jtalk;
The available parameters are:
- samplingFrequency
- fPeriod
- alpha
- beta
- speed
- addHalfTone
- msdThreshold
- gvWeightForSpectrum
- gvWeightForLogF0
- volume
- audioBuffSize
OpenJTalk#synthesizeSync(text, [optionHook])
Synthesizes voice audio synchronously from a text. This function returns buffer object.
Supported platforms
node-openjtalk currently supports following platforms.
- MacOSX/x64
- linux/ia32
- linux/x64
License
node-openjtalk is licensed under the MIT license. See LICENSE for more details.
node-openjtalk builds on OpenJTalk and hts_engine API, and is shiped with HTS Voice "NIT ATR503 M001" and "Mei". Thanks for their works.
Both OpenJTalk and hts_engine API are issued under the Modified BSD license.
HTS Voice "NIT ATR503 M001" and "Mei" are both issued under the Creative Commons Attribution 3.0 license.