Picovoice Platform
Angular API
API Reference for the Picovoice Angular SDK (npmjs).
PicovoiceService
Angular service for Picovoice Platform.
PicovoiceService.init()
Initializes the PicovoiceService
. Subscribe to the wakeWordDetection$
and inference$
subjects to receive events. If successful, isLoaded$
is set to true
.
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.
PicovoiceService.start()
Starts audio recording and processing. If successful, isListening
is set to true
.
PicovoiceService.stop()
Starts audio recording and processing. If successful, isListening
is set to false
.
PicovoiceService.release()
Releases resources acquired by the PicovoiceService
and resets all internal states.
PicovoiceService.wakeWordDetection$
Returns
- Subject<
PorcupineDetection
> : Subject which is updated when the wake word is detected.
PicovoiceService.inference$
Returns
- Subject<
RhinoInference
> : Subject which is updated when an inference has been made.
PicovoiceService.contextInfo$
Returns
- Subject<string | null> : Subject which is updated Rhino context info is available. Shows the list of intents, which expressions map to those intents, as well as slots and their possible values.
PicovoiceService.isLoaded
Returns
- Subject<boolean> : Subject indicating whether the engine is initialized successfully.
PicovoiceService.isListening$
Returns
- Subject<boolean> : Subject indicating whether the
webVoiceProcessor
is passing audio to the engine.
PicovoiceService.error$
Returns
- Subject<string | null> : Subject indicating whether an error has occurred.