0.0.2 • Published 10 years ago

htsengine v0.0.2

Weekly downloads
2
License
BSD-2-Clause
Repository
github
Last release
10 years ago

node-htsengine

Build Status

node.js for hts_engine API

Install

npm install htsengine

Example

var fs = require('fs');
var htsengine = require('htsengine');

var engine = new htsengine.engine({
    "htsvoice": htsengine.voice['en']['default']
});
// from Label File
var wavBuffer = engine.synthesizeFormFileSync(labelFile);
fs.writeFileSync(WavFile.wav, wavBuffer);
// async
engine.synthesizeFormFile(labelFile, function(err, wavBuffer) {
        if (!err) {
            fs.writeFileSync(WavFile.wav, wavBuffer);
        }
    }
});
fs.writeFileSync(WavFile.wav, wavBuffer);
// from Label Text
var wavBuffer = engine.synthesizeFormStringSync([labelText1, labelText2, labelText3, ...]);
fs.writeFileSync(WavFile.wav, wavBuffer);
// async
engine.synthesizeFormString([labelText1, labelText2, labelText3, ...], function(err, wavBuffer) {
        if (!err) {
            fs.writeFileSync(WavFile.wav, wavBuffer);
        }
    }
});

Engine options

// htsvoice   : HTS voice files
htsengine.htsvoice = "XXXX.htsvoice";
// to Array
htsengine.htsvoice = ["XXXX.htsvoice"];
// to Object
htsengine.htsvoice = [{
    "file": "XXXX.htsvoice"
}, {
    "file": "YYYY.htsvoice"
}];

// use phoneme alignment for duration
htsengine.phonemeAlignment = true;

// sampling frequency
htsengine.samplingFrequency = 48000;

// frame period (point)
htsengine.framePeriod = 240;

// all-pass constant
htsengine.allPassConstant = 0.55;

// postfiltering coefficient
htsengine.postFilteringCoefficient = 0;

// speech speed rate
htsengine.speechSpeedRate = 1;

// additional half-tone
htsengine.additionalHalfTone = 0;

// voiced/unvoiced threshold
htsengine.unvoicedThreshold = 0.5;

// enable interpolation
htsengine.htsvoice = [{
    "file": "XXXX.htsvoice",
    "interpolation": 1
}, {
    "file": "YYYY.htsvoice",
    "interpolation": 2
}];
0.0.2

10 years ago

0.0.1

10 years ago