Simple binding of OpenJTalk.

Members

(static) dictionary_dir :string

Path to builded dictionary.
Type:
  • string

Methods

(async, static) readDictionary(path_to_dictionary) → {Promise.<Dictionary>}

Read mecab dictionary.
Parameters:
NameTypeDescription
path_to_dictionaryString
Returns:
Type: 
Promise.<Dictionary>

(async, static) synthesis(text, options) → {Promise.<WaveObject>}

Synthesis voice with OpenJTalk
Parameters:
NameTypeDescription
textstringText to synthesize.
optionsOpenJTalkOptionsOpenJTalk synthesize option.
Returns:
Synthesized PCM.
Type: 
Promise.<WaveObject>

Type Definitions

Dictionary

Type:
  • Object
Properties
NameTypeDescription
unkdicUint8Array | ArrayBufferunk.dic
sysdicUint8Array | ArrayBuffersys.dic
propertyUint8Array | ArrayBufferchar.bin
matrixUint8Array | ArrayBuffermatrix.bin

OpenJTalkOptions

Type:
  • Object
Properties
NameTypeAttributesDescription
htsvoicestring | Uint8Array | ArrayBufferPath to htsvoice. Or data ArrayBuffer,Buffer.
dictionarystring | Dictionary<optional>
Dictionary object or Path to dictionary. NOT be URL nor Buffer. Must be encoded by UTF-8. The default is to use dictionary_dir.
sampling_frequencynumber<optional>
Must be int. 1<=sampling_frequency.
frame_periodnumber<optional>
Must be int. 1<=frame_period.
all_pass_constantnumber<optional>
0.0<=all_pass_constant<=1.0.
postfiltering_coefficientnumber<optional>
Default is 0.0. 0.0<=postfiltering_coefficient<=1.0.
speech_speed_ratenumber<optional>
Default is 1.0. 0<=speech_speed_rate. Warning: Do not set a very small value as it consumes CPU time.
additional_half_tonenumber<optional>
Default is 0.0.
voiced_unvoiced_thresholdnumber<optional>
Default is 0.5. 0.0<=voiced_unvoiced_threshold<=1.0.
weight_of_GV_for_spectrumnumber<optional>
Default is 1.0. 0.0<=weight_of_GV_for_spectrum.
weight_of_GV_for_log_F0number<optional>
Default is 1.0. 0.0<=weight_of_GV_for_log_F0.
volume_in_dBnumber<optional>
Default is 0.0.
audio_buffer_sizenumber<optional>
Disabled as default. 0 regarded disabled. 0<=audio_buffer_size

WaveObject

Type:
  • Object
Properties
NameTypeDescription
raw_dataBufferSynthesized PCM by host byte order.
dataInt16ArraySynthesized PCM.
bitDepth16LINEAR16.
sampleRatenumberEquals to OpenJTalkOptions#sampling_frequency if presented for synthesis function. Else automatically determined value.
numChannels1monaural.