GithubHelp home page GithubHelp logo

b0bbybaldi / node-red-matrixvoice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from johnwalicki/node-red-matrixvoice

0.0 1.0 0.0 517 KB

Examples of Matrix Voice with Node-RED and Watson

License: Apache License 2.0

node-red-matrixvoice's Introduction

Matrix Voice, Node-RED and Watson Cognitive APIs

Introduction

This repository contains examples of how I set up my Matrix Voice to record speech via Node-RED running on the Raspberry Pi. There are a few Node-RED flows which demonstrate the evolution of my experiments.

Before you can use these examples, upgrade Node-RED on your Raspberry Pi. Older versions of Node.js and Node-RED are pre-installed on the default Raspbian image. I started with Raspbian Stretch, applied distro updates, then installed Matrix Core only. I also used npm to install node-red-dashboard, node-red-contrib-microPi, node-red-contrib-snowboy, node-red-node-weather-underground and node-red-node-watson

I started at the command line and made certain that I could record audio.

/usr/bin/arecord -d 5 --device=mic_channel0 -r 16000 -c 1 -f S16_LE /home/pi/test.wav

Node-RED flows and screenshots included in this repository:

  • arecord with Matrix Voice - Simple flow which records a .wav file via the Matrix Voice 8 MEMs microphones and sends it to Watson Speech to Text for transcription.
  • arecord with Matrix Voice controlled by a Node-RED Dashboard - Same flow but controlled by a Node-RED dashboard.
  • MicroPi with Watson Speech to Text - Replace the arecord exec node with a hacked MicroPi node.
  • Snowboy wake word example - Use the Matrix Voice speaker to listen for a wake word "Hey Watson" using Snowboy
  • Full example of Matrix Voice with a wake word and Watson Cognitive API to implement a ChatBot - A bit more sophisticated example that lets you talk with your Raspberry Pi . I pass the streaming speech to node-red-contrib-snowboy to listen for a wake word. In my case “Hey Watson”. That wakes up a Node-RED flow that uses Watson Speech to Text, Watson Conversation (in another version) and Watson Text to Speech to interact with the user.

Import a prebuilt flow from GitHub

Since configuring Node-RED nodes and wiring them together requires many steps to document in screenshots, there is an easier way to build a flow by importing a prebuilt flow into your Node-RED editor.

  • Some of the sections below will have a Get the Code link.

  • When instructed, open the Get the Code github URL, mark or Ctrl-A to select all of the text, and copy the text for the flow to your Clipboard.

  • Click on the Node-RED Menu (6), then Import (7), then Clipboard (8). Node-RED import screenshot

  • Paste the text of the flow into the Import nodes dialog and press the red Import button. Node-RED import from clipboard screenshot

  • The new flow will be imported into new tabs in the Node-RED Editor.

Get the flow

As a first step, copy the code from GitHub to your Clipboard and import it into your Node-RED editor.

Get the Code - Node-RED Matrix Voice flows

Matrix Voice Node-RED Screenshots

arecord with Matrix Voice - Simple flow which records a .wav file via the Matrix Voice 8 MEMs microphones and sends it to Watson Speech to Text for transcription. arecord with Matrix Voice

arecord with Matrix Voice controlled by a Node-RED Dashboard - Same flow but controlled by a Node-RED dashboard. arecord with Matrix Voice controlled by a NR Dashboad Matrix Voice controlled by a NR Dashboad

MicroPi with Watson Speech to Text - Replace the arecord exec node with a hacked MicroPi node. MicroPi with Watson Speech to Text

Snowboy wake word example - Use the Matrix Voice speaker to listen for a wake word "Hey Watson" using Snowboy Snowboy wake word example

Full example of Matrix Voice with a wake word and Watson Cognitive API to implement a ChatBot Watson Chatbot with Matrix Voice

Hacking node-red-contrib-microPi

The node-red-contrib-micropi node expects to record USB Audio via

arecord -D plughw:1,0

Matrix Voice outputs audio on mic_channel0. You can test with

$ /usr/bin/arecord -d 5 --device=mic_channel0 -r 16000 -c 1 -f S16_LE /home/pi/test.wav

I had installed node-red-contrib-micropi into /usr/lib/node_modules, so as root, edit /usr/lib/node_modules/node-red-contrib-micropi/micropi/nodes/micropi/lib/mic.js and change

_device = options.device || 'plughw:1,0';

into

_device = options.device || 'mic_channel0';

I'll propose a formal patch to node-red-contrib-microPi

node-red-matrixvoice's People

Contributors

johnwalicki avatar

Watchers

James Cloos avatar

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.