2.0.8 • Published 1 year ago

@mastashake08/speech-kit v2.0.8

Weekly downloads
-
License
GPL
Repository
github
Last release
1 year ago

Speech Kit

GPL license Version PRs Welcome Maintenance Website jyroneparker.com Patreon Twitter CodeLife Discord online members

Simplifying the Speech Synthesis and Speech Recognition engines for Javascript. Listen for commands and perform callback actions, make the browser speak and transcribe your speech!

Features

  • Speak Commands
  • Listen for voice commands
  • Add your own grammar
  • Transcribe words and output as file.
  • Generate SSML from text for fine tune editing.

Functions

listen()

Start listening for speech recognition.

Kind: global function

stopListen()

Stop listening for speech recognition.

Kind: global function

speak(text, voice)

Use Speech Synthesis to speak text.

Kind: global function

ParamTypeDefaultDescription
textstringText to be spoken
voiceSpeechSynthesisVoiceOptional parameter to change the voice that speaks

getResultList() ⇒ SpeechRecognitionResultList

Get current SpeechRecognition resultsList.

Kind: global function
Returns: SpeechRecognitionResultList - - List of Speech Recognition results

getText() ⇒ string

Return text

Kind: global function
Returns: string - resultList as text string

getTextAsFile() ⇒ Blob

Return text file with results.

Kind: global function
Returns: Blob - transcript

getTextAsJson() ⇒ object

Return text as JSON.

Kind: global function
Returns: object - transcript

addGrammarFromUri()

Add grammar to the SpeechGrammarList from a URI.

Kind: global function
Params: string uri - URI that contains grammar

addGrammarFromString()

Add grammar to the SpeechGrammarList from a Grammar String.

Kind: global function
Params: string grammar - String containing grammar

getGrammarList() ⇒ SpeechGrammarList

Return current SpeechGrammarList.

Kind: global function
Returns: SpeechGrammarList - current SpeechGrammarList object

getRecognition() ⇒ SpeechRecognition

Return the urrent SpeechRecognition object.

Kind: global function
Returns: SpeechRecognition - current SpeechRecognition object

getSynth() ⇒ SpeechSynthesis

Return the current Speech Synthesis object.

Kind: global function
Returns: SpeechSynthesis - current instance of Speech Synthesis object

getVoices() ⇒ Array.<SpeechSynthesisVoice>

Return the current voices available to the user.

Kind: global function
Returns: Array.<SpeechSynthesisVoice> - Array of available Speech Synthesis Voices

setSpeechText()

Set the SpeechSynthesisUtterance object with the text that is meant to be spoken.

Kind: global function
Params: string text - Text to be spoken

setSpeechVoice()

Set the SpeechSynthesisVoice object with the desired voice.

Kind: global function
Params: SpeechSynthesisVoice voice - Voice to be spoken

getCurrentVoice() ⇒ SpeechSynthesisVoice

Return the current voice being used in the utterance.

Kind: global function
Returns: SpeechSynthesisVoice - current voice

share() ⇒ null

Share the text using the Web Share API or copy to Clipboard if not available

Kind: global function

createSSML() ⇒ string

Takes text and returns SSML encoded XML object

Kind: global function
Returns: string - - XML DOM object in SSML format serialized to a string
Params: string - Text to convert

parseSentenceSSML() ⇒ string

Takes sentence and returns SSML paragraph object with sentences.

Kind: global function
Returns: string - xmlString - XML DOM object in SSML format
Params: string xmlString - Text to convert

parseSSML() ⇒ object | string

Takes text and returns SSML object

Kind: global function
Returns: object | string - xmlDoc - XML DOM object in SSML format or XML object serialized to string
Params: string xmlString - Text to convert

Contributing

If you want to add functionality or fix a bug please provide a PR!

Sponsorships

This project is free for public use and will always be in perpetuity. That being said a brotha got bills to pay and ish! If you would like to sponsor this and all of my open source projects, then please consider becoming a patron on Patreon or a one time donation via Cash App

2.0.8

1 year ago

2.0.4

1 year ago

1.9.6

1 year ago

1.9.5

1 year ago

1.9.4

1 year ago

1.9.3

1 year ago

1.9.2

1 year ago

1.8.0

1 year ago

1.7.9

1 year ago

1.7.8

1 year ago

1.7.7

1 year ago

1.7.6

1 year ago

1.7.5

1 year ago

1.7.4

1 year ago

1.7.2

1 year ago

1.7.0

1 year ago

1.6.3

1 year ago

1.6.2

1 year ago

1.6.1

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago