How to use the node-wit.captureSpeechIntent function in node-wit

To help you get started, we’ve selected a few node-wit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github issmirnov / calhacks2014 / wit.js View on Github external
console.log("Sending text & audio to Wit.AI");

/*
  wit.captureTextIntent(ACCESS_TOKEN, "Hello world", function (err, res) {
      console.log("Response from Wit for text input: ");
      if (err) console.log("Error: ", err);
      console.log(JSON.stringify(res, null, " "));
  });

*/

  console.log("catching audio");
  var stream = fs.createReadStream('/tmp/sample.wav');
  console.log("stream open")

  wit.captureSpeechIntent(ACCESS_TOKEN, stream, "audio/wav", function (err, res) {
      console.log("Response from Wit for audio stream: ");
      if (err) console.log("Error: ", err);
      console.log(JSON.stringify(res, null, " "));
  });
github facebookarchive / node-app-demo / index.js View on Github external
var wit = require('node-wit');
var fs = require('fs');
var ACCESS_TOKEN = "IQ77NWUPUMNBYEUEKRTWU3VDR5YSLHTA";

console.log("Sending text & audio to Wit.AI");

wit.captureTextIntent(ACCESS_TOKEN, "Hello world", function (err, res) {
    console.log("Response from Wit for text input: ");
    if (err) console.log("Error: ", err);
    console.log(JSON.stringify(res, null, " "));
});

var stream = fs.createReadStream('sample.wav');
wit.captureSpeechIntent(ACCESS_TOKEN, stream, "audio/wav", function (err, res) {
    console.log("Response from Wit for audio stream: ");
    if (err) console.log("Error: ", err);
    console.log(JSON.stringify(res, null, " "));
});

node-wit

Wit.ai Node.js SDK

Unrecognized
Latest version published 2 years ago

Package Health Score

54 / 100
Full package analysis