p5.speech

created for p5.js.
written by R. Luke DuBois
The ABILITY lab
New York University

p5.speech is a JavaScript library that provides simple, clear access to the Web Speech and Speech Recognition APIs, allowing for the easy creation of sketches that can talk and listen.

Simple example (Synthesis):
var foo = new P5.Speech(); // speech synthesis object
foo.speak('hi there'); // say something


Simple example (Recognition):
var foo = new P5.SpeechRec(); // speech recognition object (will prompt for mic access)
foo.onResult = showResult; // bind callback function to trigger when speech is recognized
foo.start(); // start listening

function showResult()
{
   console.log(foo.resultString); // log the result
}

EXAMPLES:

Speech synthesis:
Simple speech synthesis (source)
Speech box example (uses p5.dom) (source)
Callback example (source)

Speech recognition (requires Chrome):
Simple speech recognition (source)
Continuous recognition example (source)

DOWNLOAD:

Download latest copy of the library.
View on Github.

REFERENCE:

p5.Speech

p5.SpeechRec