# babbler

> Wrapper for the Google Chrome speech synthesis and web speech recognition APIs.

Latest version **1.0.0** (published 2015-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install babbler
pnpm add babbler
yarn add babbler
bun add babbler
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-09-08 |
| First published | 2015-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Miguel Molina |
| Maintainers | mvader |
| Keywords | web, speech, speech, synthesis, voice, google, chrome, chrome |

## Links

- npm: https://www.npmjs.com/package/babbler
- Repository: https://github.com/mvader/babbler
- Issues: https://github.com/mvader/babbler/issues
- npm.io page: https://npm.io/package/babbler

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-09-08
- 0.2.0 — 2015-09-07
- 0.1.0 — 2015-09-07

## README

# babbler
Wrapper for the Google Chrome speech synthesis and web speech recognition APIs.

## Why?

Nicer API. Just that. You can very much use the vanilla speech synthesis and speech recognition APIs if you like, this just provides a nicer way to interact with them. The final decision is up to you.

## Use it

It was developed entirely with ES2015 but compiled to ES5 using babel. You will need to import it using something like browserify, webpack, etc.

Babbler exports two functions: **speak** and **recognizer**.

It does not import any es6-promise polyfill, that is up to you.

### speak

```js
import { speak } from 'babbler';

speak("Hey, it's me!").then(e => {
  console.log('Browser finished speaking!', e);
});
```

`speak` takes the string to speak and returns a promise that will be fulfilled when the browser ends speaking. The promise will be rejected if the browser does not support `speechSynthesis` API.

### recognizer

Instances a new speech recognizer.

```js
import { recognizer } from 'babbler';

let r = recognizer({
  onStart(e) {
    // foo
  },

  onEnd(e) {
    // foo
  },

  onResult(e) {
    // foo
  },

  onError(e) {
    // foo
  },

  continuous: false,
  interimResults: false
});

// Start speech recognition
r.start();

// Stop speech recognition
r.stop();

// redefine onStart callback
r.onStart(e => {
  // you can redefine the event handlers
});

// All parameters are optional in the recognizer constructor.
// In fact, you can initialize a default recognizer like this:
let r2 = recognizer();
```

## Tests

By now you must have realized the library has no tests. Why? Because everything would need to be mocked and test how a wrapper behaves with a mock does not make any sense. So don't expect any tests. It's just a wrapper, anyway.

---
_Source: https://npm.io/package/babbler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
