@fanolabs/asr
v0.1.0
Published
sdk for fanolabs asr
Downloads
5
Readme
@fanolabs/asr
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 pathdiarize
'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