speech-synthesis-text-to-speech
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Angular Text to speech

Table of contents:

Quickstart

Installing the client library

npm i speech-synthesis-text-to-speech

Using the client library

// Imports the service 
import { Text2speechService } from 'speech-synthesis-text-to-speech'

constructor(
  private text2speechService:Text2speechService
) {}

Using the library functions

  //Config variable
   configObj = {
      voiceObj: voices[1], //selected voice object
      pitch: 1, // Pitch in number
      rate: 1 // Rate in number
    }
  // Text as string
  text:string = 'This is the text to speech example'
  
  // Start speech
  this.text2speechService.StartSynthesis(this.text,this.configObj);

  // Pause speech
  this.text2speechService.pause();

  // Resume speech
  this.text2speechService.resume();

  //Stop speech
  this.text2speechService.stop();

Future Releases

  1. Event Handlers
  2. Dynamic voice, pitch and rate changes without audio break
  3. Support for lower versions

Package Sidebar

Install

npm i speech-synthesis-text-to-speech

Weekly Downloads

2

Version

0.0.2

License

none

Unpacked Size

189 kB

Total Files

40

Last publish

Collaborators

  • vaibhavimore