Socket
Socket
Sign inDemoInstall

pico-speaker

Package Overview
Dependencies
2
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pico-speaker

Pico speaker for node js (linux systems)


Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Pico speaker (TTS) module for node js

Synopsis

PicoSpeaker is a TTS module for node. I created this module for my personal assistant project on a Raspberry Pi (raspbian). I use picoSpeaker to have my raspberry talk to me.

Requirements

This module works on a linux based OS (raspbian, Ubuntu, Debian...) using alsa for audio.

Installation

This module requires pico tools and a alsa-utils to be installed.

sudo apt-get install libttspico0 libttspico-utils libttspico-data alsa-utils

You can simply add this module to your node.js project with

// sudo might be required depending on your system
npm install --save pico-speaker

Usage

There are four public methods you can use:

  • picoSpeaker.init(picoConfig); => this needs to be called to initialize clap detection. The picoConfig object is not mandatory but you can use it to overwrite the default configuration (see next section)
  • picoSpeaker.speak(text) => read text and returns a promise that is resolved when the sentenced is finished
  • picoSpeaker.repeat() => repeat last sentence returns a promise that is resolved when the sentenced is finished
  • picoSpeaker.shutUp() => interrupt all sentences being spoken at the moment
// Require the module
var picoSpeaker = require('pico-speaker');

// Define configuration
var picoConfig = {
   AUDIO_DEVICE: 'default:CARD=PCH',
   LANGUAGE: 'fr-FR'
};

// Initialize with config
picoSpeaker.init(picoConfig);

// Say hello
speaker.speak('Hello !').then(function() {
       // console.log("done");
    }.bind(this));

Configuration

You can pass a configuration object at the initialisation time (picoSpeaker.init(yourConfObject)). If you don't the following config will be used.

/* DEFAULT CONFIG */
    var CONFIG = {
        AUDIO_DEVICE: null, // will use default alsa device
        LANGUAGE: 'en-US'
    };

Tests

These will be added soon. Please do not hesitate to add some !

About the Author

I am a full-stack Javascript developer based in Lyon, France.

Check out my website

License

pico-speaker is dual licensed under the MIT license and GPL. For more information click here.

Keywords

FAQs

Last updated on 26 Nov 2016

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