0.0.2 • Published 3 years ago

speech-synthesis-text-to-speech v0.0.2

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

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