# @fanolabs/asr

> sdk for fanolabs asr

Latest version **0.1.0** (published 2020-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @fanolabs/asr
pnpm add @fanolabs/asr
yarn add @fanolabs/asr
bun add @fanolabs/asr
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-09-03 |
| First published | 2019-05-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | henry.zheng@fano.ai |
| Maintainers | henryzheng |
| Keywords | asr |

## Links

- npm: https://www.npmjs.com/package/@fanolabs/asr
- Repository: https://git.fanoai.cn/SDKs/asr-nodejs
- npm.io page: https://npm.io/package/@fanolabs/asr

## Dependencies (2)

- [form-data](https://npm.io/package/form-data.md) ^2.3.3
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0

## Recent versions

- 0.1.0 (latest) — 2020-09-03
- 0.0.9 — 2020-08-27
- 0.0.8 — 2020-08-17
- 0.0.7 — 2020-08-17
- 0.0.6 — 2020-08-03
- 0.0.5 — 2019-05-29

## README

@fanolabs/asr
==========

[![npm version][npm-image]][npm-url]

FanoLabs Asr module for Node.js

<!-- TOC -->

- [Installation](#installation)
- [License](#license)
- [API](#api)
    - [stt(filepath, diarize, recognition_model)](#stt(filepath,diarize,recognition_model))


<!-- /TOC -->

## Installation

Current stable release (`0.1.0`)

```sh
$ npm install @fanolabs/asr --save
```

## Common Usage
We suggest you load the module via `require`, pending the stabalizing of es modules in node:
```js
const ASR = require('@fanolabs/asr');
const client = new ASR({
    url: 'https://acdev.fanoai.cn/asr'
});

this.test = async function() {
    let response = await client.stt('./test.wav', 'cantonese');
    if (response.status === 200) {
        console.info(response.content);
    }
}

this.test();
```

## API

### stt(filepath,diarize,recognition_model)

- `filepath` A string representing the local wav file path 
- `diarize` 'True'/'False', default 'False'
- `recognition_model` Choose which recognition model to use.
- Returns: 

    `Note`: successful response
    ```js
    {
        'status': 200,
        'content': [{
            'recording_id': 'speech',
            'start_time': 0.83,
            'end_time': 1.62,
            'n_bests': [{
                'text': '明白街',
                'confidence': 0.121796916
            }],
            'text': '明白街',
            'confidence': 0.121796916,
            'success': True
        }]
    }
    ```

    `Note`: Error handling
    ```js
    {
        'status': 500,
        'statusText': 'Internal Server Error'
    }
    ```

## License

MIT

[npm-image]: https://flat.badgen.net/npm/v/babel-core
[npm-url]: https://www.npmjs.com/package/@fanolabs/asr

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