Rhino - Node.js API

API Reference for the Node.js Rhino SDK(npmjs) .


Rhino

class Rhino

Class for the Rhino Speech-To-Intent engine. Rhino can be initialized using the class constructor(). Resources should be cleaned when you are done using the release() method.


Rhino.constructor()

Rhino.constructor(
accessKey,
contextPath,
sensitivity = 0.5,
requireEndpoint = true,
manualModelPath,
manualLibraryPath
)

constructor method for the Rhino Speech-To-Intent engine.

Parameters

  • accessKey string : AccessKey obtained from Picovoice Console.
  • contextPath string : The path to the Rhino context file (.rhn).
  • sensitivity number : The sensitivity in the range [0,1], a higher sensitivity results in fewer misses at the cost of increasing the false alarm rate.
  • requireEndpoint boolean : If set to true, Rhino requires an endpoint (chunk of silence) before finishing inference.
  • manualModelPath string : The path to the Rhino model (.pv).
  • manualLibraryPath string : The path to the Rhino dynamic library.

Returns

  • Rhino: An instance of Rhino Speech-To-Intent engine.

Rhino.frameLength

Rhino.frameLength

The number of audio samples per frame that Rhino accepts.


Rhino.sampleRate

Rhino.sampleRate

The audio sample rate the Rhino accepts.


Rhino.process()

Rhino.process(frame)

Processes a frame of the incoming audio stream and emits the detection result. The number of samples per frame can be attained by calling .frameLength. The incoming audio needs to have a sample rate equal to .sampleRate and be 16-bit linearly-encoded. Rhino operates on single-channel audio.

Parameters

  • frame Array<number> : A frame of audio samples.

Returns

  • boolean : true when Rhino has concluded processing audio and determined the intent (or that the intent was not understood), false otherwise.

Rhino.getInference()

Rhino.getInference()

Gets inference results from Rhino. If the phrase was understood, it includes the specific intent name that was inferred, and (if applicable) slot keys and specific slot values. Should only be called after the process function returns true, otherwise Rhino has not yet reached an inference conclusion.

Returns

  • Object : Inference information (isUnderstood, intent, slots).

Rhino.release()

Rhino.release()

Releases resources acquired by Rhino


Issue with this doc? Please let us know.