
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
@picovoice/picovoice-node
Advanced tools
Made in Vancouver, Canada by Picovoice
Picovoice is an end-to-end platform for building voice products on your terms. It enables creating voice experiences similar to Alexa and Google, but it runs entirely on-device. Picovoice is:
See the Picovoice Docs for additional details.
This binding is for running Picovoice on NodeJS 16+ on the following platforms:
This binding is for NodeJS and does not work in a browser. Looking to run Picovoice in-browser? There are npm packages available for Web, and dedicated packages for Angular, React, and Vue.
Picovoice requires a valid Picovoice AccessKey
at initialization. AccessKey
acts as your credentials when using Picovoice SDKs.
You can get your AccessKey
for free. Make sure to keep your AccessKey
secret.
Signup or Login to Picovoice Console to get your AccessKey
.
The Picovoice SDK for NodeJS is available from npm:
yarn add @picovoice/picovoice-node
(or)
npm install @picovoice/picovoice-node
The SDK provides the Picovoice
class. Create an instance of this class using a Porcupine keyword and Rhino context file, as well as callback functions that will be invoked on wake word and inference events, respectively:
const Picovoice = require("@picovoice/picovoice-node");
const accessKey = "${ACCESS_KEY}" // Obtained from the Picovoice Console (https://console.picovoice.ai/)
const keywordCallback = function (keyword) {
console.log(`Wake word detected`);
};
const inferenceCallback = function (inference) {
console.log("Inference:");
console.log(JSON.stringify(inference, null, 4));
};
const handle = new Picovoice(
accessKey,
keywordArgument,
keywordCallback,
contextPath,
inferenceCallback
);
The keywordArgument
can either be a path to a Porcupine keyword file (.ppn), or one of the built-in keywords (integer enums). The contextPath
is the path to the Rhino context file (.rhn).
Upon constructing the Picovoice class, send it frames of audio via its process
method. Internally, Picovoice will switch between wake word detection and inference. The Picovoice class includes frameLength
and sampleRate
properties for the format of audio required.
// process audio frames that match the Picovoice requirements (16-bit linear pcm audio, single-channel)
while (true) {
handle.process(frameOfAudio);
}
As the audio is processed through the Picovoice engines, the callbacks will fire. This is the output when we provide the built-in "picovoice" keyword and sample "coffee maker" context to the Picovoice class, and then provide it a test WAV file that contains the following utterance:
"Picovoice, make me a large coffee"
Wake word detected
Inference:
{
"isUnderstood": true,
"intent": "orderDrink",
"slots": {
"size": "large",
"coffeeDrink": "coffee"
}
}
The Picovoice SDK for NodeJS is built on top of the Porcupine and Rhino NodeJS bindings. If you wish to use these engines individually for wake word or inference, see the Porcupine and Rhino NPM packages, respectively.
FAQs
Picovoice SDK for NodeJS
The npm package @picovoice/picovoice-node receives a total of 35 weekly downloads. As such, @picovoice/picovoice-node popularity was classified as not popular.
We found that @picovoice/picovoice-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.