Socket
Socket
Sign inDemoInstall

nuance

Package Overview
Dependencies
40
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nuance

A simple Nuance HTTP Client for NodeJS.


Version published
Maintainers
1
Created

Readme

Source

nuance-nodejs

A simple Nuance HTTP Client for NodeJS.

Installation

Download the source or use NPM:

npm install nuance --save

##Usage First, you need to create a new Nuance instance:

var Nuance = require("nuance");
var nuance = new Nuance();

The next step is loading the file:

nuance.loadFile(path, function(fileLoaded){
	if(fileLoaded){
		//continue
	}
	else{
		//Could not read the file, do something here
	}
});

After the file has been loaded successfully, we may procceed with sending the request:

nuance.sendRequest(language, id, additionalHeaders, function(error, response){
	console.log(response);
});

language = The language code (for example: "eng-USA").

id = The user's identifier - you should send here a random generated string for each user.

additionalHeaders = An object containing more headers than the default headers

error = If the request failed for some reason, the error will be the response object.

response = If successfull, returns an array with whatever Nuance analyzed. If not successfull - it will be undefined.

A whole code should look like this:

var Nuance = require("nuance");

var nuance = new Nuance();

nuance.loadFile(path, function(fileLoaded){
	if(fileLoaded){
		nuance.sendRequest(language, id, additionalHeaders, function(error, response){
			if(error){
				//An error has occurred
			}
			else{
				console.log(response);
			}
		});
	}
	else{
		//The file probably doesn't exist
	}
});

##Notes

  1. If you receive error 500 with AUDIO_INFO - the headers you had sent are probably wrong.
  2. Please make sure you are sending the right headers with the right language.
  3. Feel free to modify the default headers in the index.js file, at the moment they are set to handle AMR files.
  4. You may replace the default headers by suppling additionalHeaders, so you don't have to change the default headers in the index.js file.
  5. You need to supply apiKey and appID in the index.js file.

Keywords

FAQs

Last updated on 27 Aug 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc