@fanolabs/asr

0.1.0 • Public • Published

@fanolabs/asr

npm version

FanoLabs Asr module for Node.js

Installation

Current stable release (0.1.0)

$ npm install @fanolabs/asr --save

Common Usage

We suggest you load the module via require, pending the stabalizing of es modules in node:

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

    {
        '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

    {
        'status': 500,
        'statusText': 'Internal Server Error'
    }

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @fanolabs/asr

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

5.26 kB

Total Files

4

Last publish

Collaborators

  • henryzheng