Socket
Socket
Sign inDemoInstall

rxjs-tts

Package Overview
Dependencies
2
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rxjs-tts

RxJS text-to-speech wrapper


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

Readme

Source

RxJS wrapper for Text-to-Speech

npm i rxjs-tts

Try it online: https://stackblitz.com/edit/rxjs-tts?file=index.ts

About

This is a RxJS wrapper around browser native SpeechSynthesis.

It provides handy interface for chaining and aborting TTS.

Usage

import { speak } from 'rxjs-tts';

speak('Hello!').subscribe();

Chained

import { speak } from 'rxjs-tts';

concat(
  speak('Hello, mom!'),
  speak('How are you?'),
  speak('I miss you.')
)
  .subscribe();

Advanced usage

import { of, merge, concat, timer } from "rxjs";
import { map, takeUntil } from "rxjs/operators";
import { speak, SpeechSynthesisUtteranceConfig } from "rxjs-tts";

const a: string = "Hello, mom!";

const b: SpeechSynthesisUtteranceConfig = {
  text: "How are you?",
  lang: "en-UK",
  pitch: 1,
  rate: 1,
  volume: 1
};

const c = new SpeechSynthesisUtterance("I miss you");
c.rate = 1;
c.lang = "en-US";
c.pitch = 1;
c.rate = 1;
c.volume = 1;

concat(
  speak(a),
  speak(b),
  speak(c)
)
.subscribe((e: SpeechSynthesisEvent) => {
  console.log(e.name);
  console.log(e.type);
});

Keywords

FAQs

Last updated on 16 Jul 2020

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