Members
(static) dictionary_dir :string
Path to builded dictionary.
Type:
- string
Methods
(async, static) readDictionary(path_to_dictionary) → {Promise.<Dictionary>}
Read mecab dictionary.
Parameters:
Name | Type | Description |
---|---|---|
path_to_dictionary | String |
Returns:
- Type:
- Promise.<Dictionary>
(async, static) synthesis(text, options) → {Promise.<WaveObject>}
Synthesis voice with OpenJTalk
Parameters:
Name | Type | Description |
---|---|---|
text | string | Text to synthesize. |
options | OpenJTalkOptions | OpenJTalk synthesize option. |
Returns:
Synthesized PCM.
- Type:
- Promise.<WaveObject>
Type Definitions
Dictionary
Type:
Properties- Object
Name | Type | Description |
---|---|---|
unkdic | Uint8Array | | unk.dic |
sysdic | Uint8Array | | sys.dic |
property | Uint8Array | | char.bin |
matrix | Uint8Array | | matrix.bin |
OpenJTalkOptions
Type:
Properties- Object
Name | Type | Attributes | Description |
---|---|---|---|
htsvoice | string | | Path to htsvoice. Or data ArrayBuffer,Buffer. | |
dictionary | string | | <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_frequency | number | <optional> | Must be int. 1<=sampling_frequency. |
frame_period | number | <optional> | Must be int. 1<=frame_period. |
all_pass_constant | number | <optional> | 0.0<=all_pass_constant<=1.0. |
postfiltering_coefficient | number | <optional> | Default is 0.0. 0.0<=postfiltering_coefficient<=1.0. |
speech_speed_rate | number | <optional> | Default is 1.0. 0<=speech_speed_rate. Warning: Do not set a very small value as it consumes CPU time. |
additional_half_tone | number | <optional> | Default is 0.0. |
voiced_unvoiced_threshold | number | <optional> | Default is 0.5. 0.0<=voiced_unvoiced_threshold<=1.0. |
weight_of_GV_for_spectrum | number | <optional> | Default is 1.0. 0.0<=weight_of_GV_for_spectrum. |
weight_of_GV_for_log_F0 | number | <optional> | Default is 1.0. 0.0<=weight_of_GV_for_log_F0. |
volume_in_dB | number | <optional> | Default is 0.0. |
audio_buffer_size | number | <optional> | Disabled as default. 0 regarded disabled. 0<=audio_buffer_size |
WaveObject
Type:
Properties- Object
Name | Type | Description |
---|---|---|
raw_data | Buffer | Synthesized PCM by host byte order. |
data | Int16Array | Synthesized PCM. |
bitDepth | 16 | LINEAR16. |
sampleRate | number | Equals to OpenJTalkOptions#sampling_frequency if presented for synthesis function. Else automatically determined value. |
numChannels | 1 | monaural. |