Skip to content

deepak469/Web-Speech-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Set up

  1. Clone this project to local repository
  2. run "npm install" command
  3. run "node index.js" command and check server running on port 5000 in console.
  4. open "http://localhost://5000" in browser

For more info visit below site

https://www.smashingmagazine.com/2017/08/ai-chatbot-web-speech-api-node-js/

Demo: A Simple Voice AI Bot with Web Speech API and Node.js

This demo uses the experimental Web Speech API, which is currently only supported by Blink-based browsers including Chrome 25+, Opera 27+, Samsung Internet, QQ Browser, and Baidu Browser.

View the demo on Vimeo

View the demo on Vimeo

This is how this web app works:

  1. Using the Web Speech API’s SpeechRecognition interface to listen your voice from a microphone
  2. Send your message to API.ai (the natural language processing platform) as a text string
  3. Once the AI from the API.ai returns the reply text back, use the SpeechSynthesis interface to give it a synthetic voice.

Try It on Your Own Server

Rename the .env.local to .env and fill the env vars:

APIAI_TOKEN=
APIAI_SESSION_ID=some_unique_session_id

The first one is an API.ai API key (Please get one by sign up with API.ai), and the second one is a session ID, which is an arbitrary string (we could make this unique within the app, but that's beyond the scope of this demo).

Or use this Heroku button to deploy to Heroku server. You just need to fill out the env vars with the API key and a session ID. No need to create an .env file.

Deploy

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages