Skip to content

Commit

Permalink
Better docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm committed Jan 20, 2016
1 parent 11673c0 commit 0f65ed8
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,30 @@ var ps = new Psc({
setId: '1337' // A "set id". See explanation below.
verbose: false // Will give you a whole lot of debug output in your console.
});
```

This will return a new instance of pocketsphinx-continuous that you can listen to different events on:

### Events

#### data
This is called whenever a sentence or word is recognized and completed.
```js
ps.on('data', function(data) {
// This is called whenever a sentence or word is recognized and completed.
});
```

#### debug
This will only be called if `verbose` is set to `true`. It will give you all output from stderr from the parent process.
```js
ps.on('debug', function(data) {
// This will only be called if `verbose` is set to `true`
});
```

#### error
Something went wrong with the underlying pocketsphinx_continuous process. It was either closed or terminated. The `err` parameter might be an exit code or an error object.
```js
ps.on('error', function(err) {
// Something went wrong with the underlying pocketsphinx_continuous process.
});
```

Expand Down

0 comments on commit 0f65ed8

Please sign in to comment.