npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

neospeech

v0.1.0

Published

NeoSpeech TTS client library for Node.js

Downloads

5

Readme

NeoSpeech

neospeech is a client library for NeoSpeech TTS written in Node.js.

Dependencies

  • ffmpeg
  • libmp3lame for mp3
  • libvorbis for ogg

Refer to Installing FFmpeg section for more details.

Installation

$ npm install neospeech

Usage

var neospeech = new (require('neospeech'))({
  // host: '127.0.0.1',
  // port: 7000
});

API

Convenience Functions

neospeech.bridget(TEXT, OUT_PATH, function (err, result) {});
neospeech.hui(TEXT, OUT_PATH, function (err, result) {});
neospeech.julie(TEXT, OUT_PATH, function (err, result) {});
neospeech.junwoo(TEXT, OUT_PATH, function (err, result) {});
neospeech.kate(TEXT, OUT_PATH, function (err, result) {});
neospeech.liang(TEXT, OUT_PATH, function (err, result) {});
neospeech.misaki(TEXT, OUT_PATH, function (err, result) {});
neospeech.paul(TEXT, OUT_PATH, function (err, result) {});
neospeech.show(TEXT, OUT_PATH, function (err, result) {});
neospeech.violeta(TEXT, OUT_PATH, function (err, result) {});
neospeech.yumi(TEXT, OUT_PATH, function (err, result) {});

Request Buffer

neospeech.requestBuffer({
  text: TEXT,                 // default: ''
  speakerId: SPEAKER_ID,      // default: 'JULIE'
  voiceFormat: VOICE_FORMAT,  // default: 'DEFAULT'
  all: ALL                    // default: true, required: voiceFormat='PCM','MULAW','ALAW'
}, function (err, result) {
  // result.code
  // result.message
  // result.buffer (if value exists)
  // result.sockfd (if value exists)
});

Request Buffer Ex

neospeech.requestBufferEx({
  text: TEXT,                 // default: ''
  speakerId: SPEAKER_ID,      // default: 'JULIE'
  voiceFormat: VOICE_FORMAT,  // default: 'DEFAULT'
  textFormat: TEXT_FORMAT,    // default: 'NORMAL'
  volume: VOLUME,             // default: 100, valid: 0-500
  speed: SPEED,               // default: 100, valid: 50-400
  pitch: PITCH,               // default: 100, valid: 50-200
  dictNum: DICT_NUM,          // default: 1
  all: ALL                    // default: true, required: voiceFormat='PCM','MULAW','ALAW'
}, function (err, result) {
  // result.code
  // result.message
  // result.buffer (if value exists)
  // result.sockfd (if value exists)
});

Request Buffer SSML Ex

neospeech.requestBufferSSMLEx({
  text: TEXT,                 // default: ''
  speakerId: SPEAKER_ID,      // default: 'JULIE'
  voiceFormat: VOICE_FORMAT,  // default: 'PCM', valid: 'PCM','MULAW','ALAW'
  volume: VOLUME,             // default: 100, valid: 0-500
  speed: SPEED,               // default: 100, valid: 50-400
  pitch: PITCH,               // default: 100, valid: 50-200
  dictNum: DICT_NUM           // default: 1
}, function (err, result) {
  // result.code
  // result.message
  // result.marks
  // result.buffer (if value exists)
  // result.sockfd (if value exists)
});

Request File

neospeech.requestFile({
  text: TEXT,                // default: ''
  outPath: OUT_PATH,         // default: 'out'
  speakerId: SPEAKER_ID,     // default: 'JULIE'
  voiceFormat: VOICE_FORMAT  // default: 'DEFAULT'
}, function (err, result) {
  // result.code
  // result.message
});

Request File Ex

neospeech.requestFileEx({
  text: TEXT,                 // default: ''
  outPath: OUT_PATH,          // default: 'out'
  speakerId: SPEAKER_ID,      // default: 'JULIE'
  voiceFormat: VOICE_FORMAT,  // default: 'DEFAULT'
  textFormat: TEXT_FORMAT,    // default: 'NORMAL'
  volume: VOLUME,             // default: 100, valid: 0-500
  speed: SPEED,               // default: 100, valid: 50-400
  pitch: PITCH,               // default: 100, valid: 50-200
  dictNum: DICT_NUM           // default: 1
}, function (err, result) {
  // result.code
  // result.message
});

Request File SSML

neospeech.requestFileSSML({
  text: TEXT,                // default: ''
  outPath: OUT_PATH,         // default: 'out'
  speakerId: SPEAKER_ID,     // default: 'JULIE'
  voiceFormat: VOICE_FORMAT  // default: 'DEFAULT'
}, function (err, result) {
  // result.code
  // result.message
  // result.marks
  // result.voiceLen
});

Request Status

neospeech.requestStatus(function (err, result) {
  // result.code
  // result.message
});

Development

Compiling C++ Binding

$ node-gyp configure && node-gyp build

Installing FFmpeg

Ubuntu

$ apt-get install ffmpeg libavcodec-extra-52
$ apt-get install lame vorbis-tools
$ apt-get install libmp3lame-dev libmpg123-dev

Amazon Linux / Cent OS

yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_src

# yasm
yum install yasm

# libfdk_aac
cd ~/ffmpeg_src
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
autoreconf -fiv
./configure --disable-shared
make
make install
make distclean

# libmp3lame
cd ~/ffmpeg_src
curl -L -O http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
tar xzvf lame-3.99.5.tar.gz
cd lame-3.99.5
./configure --disable-shared --enable-nasm
make
make install
make distclean

# libogg
cd ~/ffmpeg_src
curl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz
tar xzvf libogg-1.3.1.tar.gz
cd libogg-1.3.1
./configure --disable-shared
make
make install
make distclean

# libvorbis
cd ~/ffmpeg_src
curl -O http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
tar xzvf libvorbis-1.3.3.tar.gz
cd libvorbis-1.3.3
./configure --disable-shared
make
make install
make distclean

# ffmpeg
cd ~/ffmpeg_src
git clone --depth 1 git://source.ffmpeg.org/ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-nonfree --enable-pthreads --enable-postproc --enable-libfdk_aac --enable-libmp3lame --enable-libvorbis --enable-filters --enable-runtime-cpudetect
make
make install
make distclean

Credits

See the contributors.

License