Skip to content

Microphone in the browser using WebRTC and WebSockets

License

Notifications You must be signed in to change notification settings

frankwo1/microphone

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microphone

## Quickstart

See quickstart.md

Example

Home automation demo

Demo

(Source code: https://github.com/wit-ai/house)

API

Here are the methods available on the Microphone object

Assumptions

You know how to create the microphone. See quickstart.md for instructions on how to create your microphone.

Available methods

connect(token)

connect the microphone to the Wit instance identified by the token


start()

start streaming audio to the Wit instance (also achieved by clicking on the microphone element on the page)


stop()

stop recording audio (also achieved by clicking on the microphone element on the page). Wit will send a response, received via the onresult handler.


onready(callback)

call the given callback when the microphone is ready to record


onresult(callback)

call the given callback when a response is received from the instance. The callback function takes two arguments: a string corresponding to the detected intent, and a list of entity objects.


onerror(callback)

call the given callback whenever an error occurs. An error string is passed to the callback function.


onaudiostart(callback)

call the given callback when the recording starts.


onaudioend(callback)

call the given callback when the recording stops


onconnecting(callback)

call the given callback when Microphone is waiting for the server to reply or for the user to allow access to her microphone.


ondisconnected(callback)

call the given callback when the connection is closed by the server or the client.

How to build

Dev

grunt serve

### Release

# bump version in bower.json
./release.sh

About

Microphone in the browser using WebRTC and WebSockets

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 40.3%
  • JavaScript 30.2%
  • HTML 14.9%
  • CSS 8.0%
  • Shell 6.6%