
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@usefulsensors/moonshine-js
Advanced tools
On-device speech-to-text and voice control for web applications with Moonshine.
MoonshineJS makes it easy for web developers to build modern, speech-driven web experiences without sacrificing user privacy. We build on three key principles:
Note: This package is currently in beta, and breaking changes may occur between versions. User feedback and developer contributions are welcome.
You can use MoonshineJS via CDN, or you can install it with npm
. Simply import the package depending on your preferred method.
import * as Moonshine from "https://cdn.jsdelivr.net/npm/@usefulsensors/moonshine-js@latest/dist/moonshine.min.js";
npm
Install the package first:
npm install @usefulsensors/moonshine-js
Then import:
import * as Moonshine from "@usefulsensors/moonshine-js";
Let's get started with a simple example. We'll create a transcriber to print speech from the microphone to the console. We can use the MicrophoneTranscriber for that. You can control the behavior of the transcriber by passing it a set of callbacks when you create it:
import * as Moonshine from "https://cdn.jsdelivr.net/npm/@usefulsensors/moonshine-js@latest/dist/moonshine.min.js";
var transcriber = new Moonshine.MicrophoneTranscriber(
"model/tiny", // the fastest and smallest Moonshine model
{
onTranscriptionUpdated(text) {
console.log(text);
},
}
);
transcriber.start();
When we start the transcriber, the browser will request mic permissions and begin printing everything the user says to the console. It is useful in some cases to wait until the user has stopped speaking to transcribe their words. In this case, we'll enable voice activity detection (VAD) when we create the transcriber:
var transcriber = new Moonshine.MicrophoneTranscriber(
"model/tiny",
{
onTranscriptionUpdated(text) {
console.log(text);
},
},
true // enable voice activity detection
);
transcriber.start();
Now the transcription will only update between pauses in speech.
That's all it takes to get started! Read the guides to learn how to transcribe audio from other sources, or to build voice-controlled applications.
MoonshineJS also provides a polyfill for the Web Speech API. Usage is as follows:
import * as Moonshine from "https://cdn.jsdelivr.net/npm/@usefulsensors/moonshine-js@latest/dist/moonshine.min.js";
var transcriber = new Moonshine.MoonshineSpeechRecognition();
transcriber.addEventListener("result", (e) => {
console.log("result:", e.results[0][0].transcript);
});
MoonshineJS is developed and maintained by Useful Sensors.
The code in this repo and the English-language Moonshine speech to text model it uses are released under the MIT license. The Spanish-language speech to text model is released under the Moonshine AI Community License for researchers, developers, small businesses, and creators with less than $1M in annual revenue.
FAQs
On-device speech-to-text and voice control for web applications with Moonshine.
The npm package @usefulsensors/moonshine-js receives a total of 6 weekly downloads. As such, @usefulsensors/moonshine-js popularity was classified as not popular.
We found that @usefulsensors/moonshine-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.