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!
- Speak Commands
- Listen for voice commands
- Add your own grammar
- Transcribe words and output as file.
- Generate SSML from text for fine tune editing.
- listen()
Start listening for speech recognition.
- stopListen()
Stop listening for speech recognition.
- speak(text, [voice])
Use Speech Synthesis to speak text.
- getResultList() ⇒
SpeechRecognitionResultList
Get current SpeechRecognition resultsList.
- getText() ⇒
string
Return text
- getTextAsFile() ⇒
Blob
Return text file with results.
- getTextAsJson() ⇒
object
Return text as JSON.
- addGrammarFromUri()
Add grammar to the SpeechGrammarList from a URI.
- addGrammarFromString()
Add grammar to the SpeechGrammarList from a Grammar String.
- getGrammarList() ⇒
SpeechGrammarList
Return current SpeechGrammarList.
- getRecognition() ⇒
SpeechRecognition
Return the urrent SpeechRecognition object.
- getSynth() ⇒
SpeechSynthesis
Return the current Speech Synthesis object.
- getVoices() ⇒
Array.<SpeechSynthesisVoice>
Return the current voices available to the user.
- setSpeechText()
Set the SpeechSynthesisUtterance object with the text that is meant to be spoken.
- setSpeechVoice()
Set the SpeechSynthesisVoice object with the desired voice.
- getCurrentVoice() ⇒
SpeechSynthesisVoice
Return the current voice being used in the utterance.
- share() ⇒
null
Share the text using the Web Share API or copy to Clipboard if not available
- createSSML() ⇒
string
Takes text and returns SSML encoded XML object
- parseSentenceSSML() ⇒
string
Takes sentence and returns SSML paragraph object with sentences.
- parseSSML() ⇒
object
|string
Takes text and returns SSML object
Start listening for speech recognition.
Stop listening for speech recognition.
Use Speech Synthesis to speak text.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
text | string |
Text to be spoken | |
[voice] | SpeechSynthesisVoice |
|
Optional parameter to change the voice that speaks |
Get current SpeechRecognition resultsList.
Kind: global function
Returns: SpeechRecognitionResultList
- - List of Speech Recognition results
Return text
Kind: global function
Returns: string
- resultList as text string
Return text file with results.
Kind: global function
Returns: Blob
- transcript
Return text as JSON.
Kind: global function
Returns: object
- transcript
Add grammar to the SpeechGrammarList from a URI.
Kind: global function
Params: string
uri - URI that contains grammar
Add grammar to the SpeechGrammarList from a Grammar String.
Kind: global function
Params: string
grammar - String containing grammar
Return current SpeechGrammarList.
Kind: global function
Returns: SpeechGrammarList
- current SpeechGrammarList object
Return the urrent SpeechRecognition object.
Kind: global function
Returns: SpeechRecognition
- current SpeechRecognition object
Return the current Speech Synthesis object.
Kind: global function
Returns: SpeechSynthesis
- current instance of Speech Synthesis object
Return the current voices available to the user.
Kind: global function
Returns: Array.<SpeechSynthesisVoice>
- Array of available Speech Synthesis Voices
Set the SpeechSynthesisUtterance object with the text that is meant to be spoken.
Kind: global function
Params: string
text - Text to be spoken
Set the SpeechSynthesisVoice object with the desired voice.
Kind: global function
Params: SpeechSynthesisVoice
voice - Voice to be spoken
Return the current voice being used in the utterance.
Kind: global function
Returns: SpeechSynthesisVoice
- current voice
Share the text using the Web Share API or copy to Clipboard if not available
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
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
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
If you want to add functionality or fix a bug please provide a PR!
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