Skip to content

Web Audio Speech Synthesis / Recognition for p5.js

Notifications You must be signed in to change notification settings

shiffman/p5.js-speech

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 

Repository files navigation

p5.js-speech

Web Audio Speech Synthesis and Speech Recognition Implementation for p5.js (http://p5js.org)

R. Luke DuBois (dubois@nyu.edu)
ABILITY Lab / Brooklyn Experimental Media Center
NYU

This is a simple p5 extension to provide Web Speech (Synthesis and Recognition) API functionality. It consists of two object classes (p5.Speech and p5.SpeechRec) along with accessor functions to speak and listen for text, change parameters (synthesis voices, recognition models, etc.), and retrieve callbacks from the system.

Speech recognition requires launching from a server (e.g. a python simpleserver on a local machine).

Simple Example (Synthesis)

var voice = new p5.Speech(); // speech synthesis object
voice.speak('hi there'); // say something

Simple Example (Recognition)

var speechRec = new p5.SpeechRec(gotSpeech); // speech recognition object (will prompt for mic access)
speechRec.start(); // start listening

function gotSpeech(speech) {
  console.log(speech.text); // log the result
}

About

Web Audio Speech Synthesis / Recognition for p5.js

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%