Some objects that will simplify the usage of web speech API. Run "Gulp build" for a concatenated version.
Speaker - Class that handles the speech synthesis.
Creates a new speaker instance.
String that will be synthesized.
There is an issue with long strings. It is advised not to put strings longer than 250 characters in the constructor. Declarations are automatically cut in punctuation marks so whole statement can be longer. It applies only to very log sentences without any dots, questionmarks or exclamation mark.
Informs if player is currently synthesizing. True, also when syntesis is paused. (Get only)
Informs if players is currently paused. (Get only)
Grants access to instance of speech synthesiser object.
Starts synthesis based on string given to constructor.
Pauses the player.
Resumes the player, at the point it was paused
Stops the synthesis. When it is started again, it will start the synthesis at the begining of the string.
Fires when synthesis starts.
Fires when synthesis is paused.
Fires when synthesis is resumed (after pause).
Fires when synthesis ends.
Command - Helper class that contains methods we want to run and voice commands assigned to them.
new Command(orders, callback);
Creates an command instance. Takes an array of orders and a callback that will be called with those orders.
orders (Array of Strings)
List of strings. When an order is recognized, callback will be called.
Function that will be called after an order recognition.
Reciever - Class responsible for listening and speech recognition.
new Reciever(language, commandList);
Creates a listener instance.
Language in wich the speech sample will be provided in BCP 47 format, e.g. "pl" for polish, "eng" for english.
commandList (Array of Commands)
An array of command objects, which methods we want to call.
Informs if reciever is actually recording. (Get only)
Informs if reciever is in continuous mode (default False).
Grants access to the "recogniser" object.
Fires when recognition starts.
Fires when recognition ends.