0.1.0 • Published 4 years ago

@fanolabs/asr v0.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

@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

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago