Giter VIP home page Giter VIP logo

node-red-contrib-speakerpi's Introduction

node-red-contrib-speakerpi

A Node-RED node to give a provided sound (WAV,OGG) out on the defined output (hdmi or chinch or defined). This node is designed to work on Raspberry Pi and will be good in using with Watson APIs like text-to-speach to demonstrate cognitive iot.

Install

Run the following command in the root directory of your Node-RED install or home directory (usually ~/.node-red).

    npm install node-red-node-speakerpi

Additionally you have to install on the Raspberry Pi

sudo apt-get update sudo apt-get install libasound2-dev

sound set to Analog output

amixer cset numid=3 1

sound set to HDMI

amixer cset numid=3 2

sound set volume

alsamixer

##Usage

Provides a sound-node for sending out a sound to the connected speaker. There are two modes - filebased and streambased.

Filebased

Within the filebased mode the Raspberry Pi Player APLAY is issued with a file. This brings out best quality with minimum resources needed from the play. If the msg.speech is given as an input it will be dumped into a file and after playing the temporary file it will be deleted. By defining msg.predefsound (set of predefined soundfiles within the package) or setting a msg.filename which includes /path/filename.wav - this will be played.

Streambased

The streambased mode is for streaming directly the buffer into a speaker framework (using node-speaker)

speakerPi output node

The msg.speech as an input contains the WAV/OGG .

The node also needs a defined sound configuration which contains channels (1 or 2), the bitdepth (8 or 16) and the samplerate (22050 or 44100) set in the node or in the msg.speakerConfig for the sound in msg.speech.

speakerConfig = { 
	channels: 1
	bitdepth: 16
	samplerate: 22050
	 }

node-red-contrib-speakerpi's People

Contributors

o-hahn avatar

Watchers

Boris Crismancich 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.