Picovoice Platform
Vue API
API Reference for the Picovoice Vue SDK (npmjs).
PicovoiceVue
PicovoiceVue
type.
state
object :PicovoiceVue
internal states.wakeWordDetection
PorcupineDetection | null : A state that is updated when the wake word has been detected.inference
RhinoInference | null : A state that is updated when an inference has been made.contextInfo
string | null : A state that updates when Rhino context info is available. Shows the list of intents, which expressions map to those intents, as well as slots and their possible values.isLoaded
boolean : A state indicating whether the engine is initialized successfully.isListening
boolean : A state indicating whether thewebVoiceProcessor
is passing audio to the engine.error
string | null : A string expression of the error.
init
(...) => Promise<void> : A method to initialize the internalPicovoiceWorker
. Seeinit
.start
() => Promise<void> : A method to start processing the audio. Seestart
.stop
() => Promise<void> : A method to stop processing the audio. Seestop
.release
() => Promise<void> : Releases resources acquired byPicovoiceVue
. Seerelease
usePicovoice
Vue reactive API for Picovoice
SDK.
Returns
PicovoiceVue
: States and functions forPicovoice
Vue binding.
init()
Initializes the internal PicovoiceWorker
. Sets state.isLoaded
state to true
if successful.
Parameters
accessKey
string : AccessKey obtained from Picovoice Console.keyword
PorcupineKeyword : A Porcupine keyword. Can be provided as a built-in, base64 or a hosted.ppn
file.porcupineModel
PorcupineModel : Contains the model parameters that are used to initialize the Porcupine engine. Model can be encoded in base64 or can be stored in a.pv
file in a public directory.context
RhinoContext : A Rhino context. Can be provided as a base64 or a hosted.rhn
file.rhinoModel
RhinoModel : Contains the model parameters that are used to initialize the Rhino engine. Model can be encoded in base64 or can be stored in a.pv
file in a public directory.options
PicovoiceOptions : Optional configuration arguments.
start()
Starts audio recording and processing. If successful, state.isListening
is set to true
.
stop()
Stops audio recording and processing. If successful, state.isListening
is set to false
.
release()
Releases resources acquired by the Picovoice
and resets all internal states.