Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Number of audio samples per frame. FrameLength int // Audio sample rate accepted by Picovoice. SampleRate int // Rhino version Version string )
Functions ¶
This section is empty.
Types ¶
type PvStatus ¶
type PvStatus int
PvStatus type
const ( SUCCESS PvStatus = 0 OUT_OF_MEMORY PvStatus = 1 IO_ERROR PvStatus = 2 INVALID_ARGUMENT PvStatus = 3 STOP_ITERATION PvStatus = 4 KEY_ERROR PvStatus = 5 INVALID_STATE PvStatus = 6 RUNTIME_ERROR PvStatus = 7 ACTIVATION_ERROR PvStatus = 8 ACTIVATION_LIMIT_REACHED PvStatus = 9 ACTIVATION_THROTTLED PvStatus = 10 ACTIVATION_REFUSED PvStatus = 11 )
Possible status return codes from the Rhino library
type Rhino ¶
type Rhino struct { // AccessKey obtained from Picovoice Console (https://console.picovoice.ai/). AccessKey string // Absolute path to Rhino's dynamic library. LibraryPath string // Absolute path to the file containing model parameters. ModelPath string // Inference sensitivity. A higher sensitivity value results in // fewer misses at the cost of (potentially) increasing the erroneous inference rate. // Sensitivity should be a floating-point number within 0 and 1. Sensitivity float32 // Endpoint duration in seconds. An endpoint is a chunk of silence at the end of an // utterance that marks the end of spoken command. It should be a positive number within [0.5, 5]. A lower endpoint // duration reduces delay and improves responsiveness. A higher endpoint duration assures Rhino doesn't return inference // preemptively in case the user pauses before finishing the request. EndpointDurationSec float32 // Absolute path to the Rhino context file (.rhn). ContextPath string // If set to `true`, Rhino requires an endpoint (a chunk of silence) after the spoken command. // If set to `false`, Rhino tries to detect silence, but if it cannot, it still will provide inference regardless. Set // to `false` only if operating in an environment with overlapping speech (e.g. people talking in the background). RequireEndpoint bool // Once initialized, stores the source of the Rhino context in YAML format. Shows the list of intents, // which expressions map to those intents, as well as slots and their possible values. ContextInfo string // contains filtered or unexported fields }
Rhino struct
func (*Rhino) GetInference ¶
func (rhino *Rhino) GetInference() (inference RhinoInference, err error)
Gets inference results from Rhino. If the spoken command 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 an inference struct with `.IsUnderstood`, '.Intent` , and `.Slots`.
type RhinoError ¶
func (*RhinoError) Error ¶
func (e *RhinoError) Error() string
type RhinoInference ¶
Click to show internal directories.
Click to hide internal directories.