Coder Social home page Coder Social logo

node-google-text-to-speech's Introduction

This Node Module is no longer maintained!

==========================

node-google-text-to-speech

Google Text-To-Speech for node.js

A small library for translating text-to-speech service for google.

Installation

npm install node-google-text-to-speech --save

Usage

  var tts = require('node-google-text-to-speech')

  tts.translate('en', 'dog', function(result) {
  	console.log(result); 
  	if(result.success) { //check for success
  		var response = { 'audio' : result.data };
  		socket.emit('ttsResult', response); //emit the audio to client
  	}
  });

Release History

  • 0.1.0 Initial release

node-google-text-to-speech's People

Contributors

avivshafir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

node-google-text-to-speech's Issues

Errors installing on Raspberry Pi

Hi receive the following error when trying to install

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli 'node-google-text-to-speech',
1 verbose cli '--save' ]
2 info using [email protected]
3 info using [email protected]
4 silly cache add args [ 'node-google-text-to-speech', null ]
5 verbose cache add spec node-google-text-to-speech
6 silly cache add parsed spec { raw: 'node-google-text-to-speech',
6 silly cache add scope: null,
6 silly cache add name: 'node-google-text-to-speech',
6 silly cache add rawSpec: '',
6 silly cache add spec: '',
6 silly cache add type: 'range' }
7 verbose addNamed node-google-text-to-speech@

8 silly addNamed semver.valid null
9 silly addNamed semver.validRange *
10 silly addNameRange { name: 'node-google-text-to-speech',
10 silly addNameRange range: '*',
10 silly addNameRange hasData: false }
11 silly mapToRegistry name node-google-text-to-speech
12 silly mapToRegistry using default registry
13 silly mapToRegistry registry https://registry.npmjs.org/
14 silly mapToRegistry uri https://registry.npmjs.org/node-google-text-to-speech
15 verbose addNameRange registry:https://registry.npmjs.org/node-google-text-to-speech not in flight; fetching
16 verbose request uri https://registry.npmjs.org/node-google-text-to-speech
17 verbose request no auth needed
18 info attempt registry request try #1 at 01:04:56
19 verbose request id a5fa21385f33ce97
20 http request GET https://registry.npmjs.org/node-google-text-to-speech
21 info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org
22 info attempt registry request try #2 at 01:05:47
23 http request GET https://registry.npmjs.org/node-google-text-to-speech
24 info retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org
25 info attempt registry request try #3 at 01:07:27
26 http request GET https://registry.npmjs.org/node-google-text-to-speech
27 verbose stack Error: getaddrinfo ENOTFOUND registry.npmjs.org
27 verbose stack at errnoException (dns.js:44:10)
27 verbose stack at GetAddrInfoReqWrap.onlookup as oncomplete
28 verbose cwd /home/osmc/quick2wire-gpio-admin/pi-node-relay
29 error Linux 3.18.5-v7+
30 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node-google-text-to-speech" "--save"
31 error node v0.12.0
32 error npm v2.5.1
33 error code ENOTFOUND
34 error errno ENOTFOUND
35 error syscall getaddrinfo
36 error network getaddrinfo ENOTFOUND registry.npmjs.org
36 error network This is most likely not a problem with npm itself
36 error network and is related to network connectivity.
36 error network In most cases you are behind a proxy or have bad network settings.
36 error network
36 error network If you are behind a proxy, please make sure that the
36 error network 'proxy' config is set properly. See: 'npm help config'
37 verbose exit [ 1, true ]

Special characters in URL don't turn out right

Thanks for the example, this is working great!
I had some problems running this on node when there were special characters in the text, e.g. accented characters. Calling e.g. 'más' in Spanish works fine in my browser, but doesn't come out right here.

What I found is that for some strange reason, I had to set a User-Agent header in my node request, like so:

var r = request({uri: url, headers: {'User-Agent': 'Mozilla/5.0'}}, function (error, response, buffer) {
    ...
});

This way, special characters turn out right just the way they do in the browser.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.