Baidu Yuyin API
This is a forked repo of baidu_yuyin. Currently under development, use with caution.
The original README is here(in Chinese).
Usage
Need Nodejs v6 above to run this module.
Installation
npm install baidu-yuyin-api
Examples
var BaiduYuyin = require("baidu-yuyin-api");
var speech = new BaiduYuyin(apiKey, secretKey, 'afplay', null, false);
var optt = {tex: 'English testing, Hello world', lan: 'zh'};
var optcn = {lan: 'zh'};
var opten = {format: 'wav', lan: 'en'};
speech.on('ready', () => {
speech.speak("你好世界")
.then(() => {
return speech.speak(null, optt);
})
.then(() => {
return speech.speak("测试结束");
})
.then(() => {
return speech.recognize(fs.readFileSync('./test.pcm'), optcn);
})
.then(() => {
return speech.recognize(fs.readFileSync('./test_en.wav'), opten);
});
});
Test
Clone the repo to local, and run npm test
.
Change Logs
Update 0.1.8 [2016-12-01]
- Make sure only renew session file when necessary
- Minor fixes on README
- Correct miss spelling words
Update 0.1.7 [2016-11-30]
- Fix the samples in README
- Add test API key in config.json
- Auto renew session token if it expired (30 days)
Update 0.1.6 [2016-11-29]
- Update README
- Update test samples
- Text to speech not support English output
Update 0.1.4 [2016-11-29]
- Supporting speech recognition
- Using
NODE_DEBUG=request node test.js
to test HTTP request
Update 0.1.3 [2016-11-28]
- Using Linux file system
- Support wmplayer and vlc player on Windows platform
Update 0.1.2 [2016-11-27]
- Rewrite code style
- Fix minor issues