Package Exports
- turen
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (turen) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-turen
The Node.js client for TurenCore.
Installation
$ npm install turen --saveGet Started
var options = {
host: 'apigwws.open.rokid.com',
port: 443,
key: 'rokid openplatform key',
secret: 'rokid openplatform secret',
deviceTypeId: 'rokid device type id',
deviceId: 'rokid device id',
};
var speech = new TurenSpeech();
speech.on('voice coming', (event) => {
// voice coming
});
speech.on('voice accept', (event) => {
// voice accept
});
speech.on('asr end', (asr, event) => {
// asr
});
speech.on('nlp', (response, event) => {
// response.asr
// response.nlp
// response.action
});
speech.start(options);Services
TurenCore provides multiple socket-based services for different functionalities.
RPC
Rpc service is used to call method of TurenCore, which includes:
Restart()RestartWithoutArgs()Pickup()IsPickup()OpenMic()SetStack()SetSkillOption()
CMD
Cmd service is used to call debug method which includes:
openMic()closeMic()pickup()reset()readyForAsr()setAngle(deg)
Event
Event service is to be notified for all voice and nlp events, includes:
voice comingreturns the speechenergyand directionslwhen triggered locally.voice local sleepwhen sleep locally.asr beginwhen cloud speech recognition begins.asr endreturns the final valueasrwhen cloud speech recognition ends.nlpreturns thenlpandactionwhen NLP is done.
A complete events list is at here.
Audio
Audio services is also to debug with TurenCore, we could pull audio streams from every stage like AEC/BF/VAD.
License
MIT