Socket
Socket
Sign inDemoInstall

speech-stream

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    speech-stream

Text-to-speech using streams. Stream configuration data, text. Output audio buffers.


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

speech-stream

Text-to-speech using streams. Stream configuration data, text. Output audio buffers.

API

The API is very minimal. You just create a transform stream that takes in voice configuration data and outputs

`SpeechStream([default_voice])``

Creates a new SpeechStream and optionally takes a default voice to use. Documentation on the voice options can be found here.

parameters
  • [default_voice]: Optional Object containing voice configuration. If this isn't provided, a random is generated using randomvoice.
returns
  • SpeechStream: A Duplex stream which takes in objects that contain a message property which is a string, and optionally a voice property which contains the aforementioned voice configuration data.

Example:

var streamArray = require("stream-array");
var makeProp = require("make-prop-stream");
var speechStream = require("speech-stream");
var fs = require("fs");

streamArray(["Hello World!"])
.pipe(makeProp("message"))
.pipe(speechStream())
.pipe(fs.createWriteStream("example.wav"));

Note: this example doesn't work well with multiple messages since it'll concatenate the buffer data together. A better use would be to pipe this into something that either saves everything or outputs to your speakers.

Keywords

FAQs

Last updated on 07 Dec 2014

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