0.9.2 • Published 7 years ago

nictalk v0.9.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

nictalk

npm module for TTS with NICT

NPM

Build Status npm version Code Climate MIT License

About nictalk

Node.js上で動作する音声合成モジュール
You can use TTS.
All processes of TTS (text to speech) are combined into only one command.
This module relies on NICT for sounds generation from text. And speech section is the diversion of the code of simplayer.
Each technology belongs to them, respectively.

Install

Before use this, you need to build an environment to play sound.

npm install nictalk --save

when you make the path, nictalk can be used on not only Node.js but also command line.

Usage

####On Node.js This is a basic source. Only run node app.js.

var NICTalk = require("nictalk");

var speaker = new NICTalk();

speaker.speak("voice", "Hello world.", function(error){
	if (error) throw error;
	console.log('End of Speech.');
});

When it succeeds, "voice.wav" is created in the current directory. And the sound "Hello world." be played.
In the above example, speaker holds the following members basically. You can change them as necessary whith json.

var defaultParams = {
	"version" : "1.1",
	"language" : "ja",			//Japanese(ja), Chinese(zh), Korean(ko) or English(en)
	"voiceType" : "*",				
	"audioType" : "audio/x-wav",
	"directory" : ""			//Current Directory
};

These parameters can be changed with following method.

setParams(json);		ex)setParams({"language" : "en", "directory" : "/home/voices"});

setLanguage(lang);		ex)	setLanguage("en");

setDirectory(path);		ex)	setDirectory("/home/voices/");
speak(file, [text], [callback]);

"text" and "callback" can be omit. when "text" is omit, it only play "file"; "file" specify the file name (in the current directory) or path. This file's path is shaped like "directory"+"file"+".wav".
it can practically use like this.

var NICTalk = require("nictalk");

var Japanese = new NICTalk();

var English = new NICTalk({"language" : "en", "directory" : "./english/"});

var Chinese = new NICTalk();
Chinese.setParams({"language" : "zh", "directory" : "./chinese/"});

var Korean = new NICTalk();
Korean.setLanguage("ko");
Korean.setDirectory("./korean/");

Japanese.speak("voice", "こんにちは", function(){
  English.speak("voice", "Hello", function(){
    Chinese.speak("voice", "你好", function(){
      Korean.speak("voice", "안녕하세요");
    });
  });
});

####On command line

This module can be used on command line.
In this case, you have to global install this module.

npm install nictalk -g

The command is below.

nictalk 'file' [text]

This works exactly the same as speak(file, [text]);.

ex)	nictalk /home/voices/hello Hello.

###LICENSE

####MIT

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.11

7 years ago

0.7.10

7 years ago

0.7.9

7 years ago

0.7.8

7 years ago

0.7.7

7 years ago

0.7.6

7 years ago

0.7.5

7 years ago

0.7.3

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.4

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago