hark js code example

Example 1: hark javascript

var speech = hark(stream, options);
speech.on('speaking', function() {
  console.log('Speaking!');
});

Example 2: hark javascript

var hark = require('../hark.js')

  var getUserMedia = require('getusermedia')

  getUserMedia(function(err, stream) {
    if (err) throw err

    var options = {};
    var speechEvents = hark(stream, options);

    speechEvents.on('speaking', function() {
      console.log('speaking');
    });

    speechEvents.on('stopped_speaking', function() {
      console.log('stopped_speaking');
    });
  });