
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.
speech-command-engine
Advanced tools
The speech-command-engine
package allows you to integrate voice commands into your web application. This package provides functions to start and stop voice recognition, as well as handle voice commands.
startVoiceRecognition
Starts the voice recognition process using the provided configuration.
Parameters:
config
(optional VoiceRecognitionConfig
): Configuration options for the voice recognition process.Usage Example:
import { startVoiceRecognition } from "speech-command-engine";
startVoiceRecognition({
autoStart:true
continuous: true,
scrollAmount: 1000,
});
now say `refresh page` command : the page should refresh automatically
stopVoiceRecognition
Stops the voice recognition process. This is useful for pausing or ending the voice command functionality.
import { stopVoiceRecognition } from "speech-command-engine";
stopVoiceRecognition();
data-cmd
Attributes with speech-command-engine
To enable voice commands on specific elements in your web application, set a data-cmd
attribute on any HTML element you want to control via voice. The value of this attribute should represent the action you want to trigger.
When the user says the predefined command followed by the value of the data-cmd
attribute, the corresponding event or action will be executed.
Here’s a practical example of how to set up elements with data-cmd
attributes:
<!-- When you say click on submit , this button will be clicked -->
<button data-cmd="submit">Submit</button>
<!-- Here You should focus on the input or textarea u want by saying focus on {data-cmd value}
then fill out {anything u need to fill out with}
for the input below :
1-focus on email field
2-fill out hello world
-->
<input type="email" data-cmd="email field" placeholder="Enter your email" />
VoiceRecognitionConfig
Configuration options for the voice recognition process.
Property | Type | Description |
---|---|---|
language | string | The language to use for voice recognition (e.g., "en-US"). |
continuous | boolean | Whether the voice recognition should continue indefinitely. |
interimResults | boolean | Whether to receive interim results before final results are available. |
scrollAmount | number | The amount to scroll in pixels for scroll commands. |
grammar | string | Optional grammar for defining command patterns. |
VoiceEvents
Possible voice command events.
Property | Description |
---|---|
click on | Clicks on an element specified by the command. |
navigate to | Navigates to the URL specified by the command. |
back | Navigates back in the browser history. |
forward | Navigates forward in the browser history. |
fill out | Fills out an input field specified by the command. |
clear | Clears the value of an input field. |
scroll up | Scrolls up the page by the specified amount. |
scroll down | Scrolls down the page by the specified amount. |
refresh | Refreshes the current page. |
focus on | Focuses on an element specified by the command. |
up | Scrolls to the top of the page. |
down | Scrolls to the bottom of the page. |
FAQs
A package for handling voice commands and speech recognition.
The npm package speech-command-engine receives a total of 0 weekly downloads. As such, speech-command-engine popularity was classified as not popular.
We found that speech-command-engine 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
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.