Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
speech-to-text-toolkit
Advanced tools
A web component that a developer can use to enable accurate speech-to-text, either locally or in the cloud, in their web-based application, including a WebView.
The Speech-To-Text Web Toolkit is a web component that a developer can use to enable accurate speech-to-text, either locally or in the cloud, in their web-based application, including a WebView. Think of it as an upgrade to the Web Speech API.
Speech-To-Text uses the Azure Speech Recognition API to do speech-to-text in the cloud. For local speech-to-text, Speech-To-Text uses Transformers.js to run the OpenAI Whisper model locally.
npm i speech-to-text-toolkit
<!-- this will do speech-to-text locally on your device, see below this code block for more examples -->
<speech-to-text localOrCloud="local">
<button id="start-button">Start</button>
<button id="stop-button">Stop</button>
</speech-to-text>
<script type="module">
document.querySelector('#start-button').addEventListener('click', startRecording);
document.querySelector('#stop-button').addEventListener('click', stopRecording);
const speechToText = document.querySelector('speech-to-text');
speechToText.addEventListener('recognized', (e) => {
console.log('recognized', e.detail);
});
function startRecording() {
console.log('startRecording');
speechToText.startSpeechToText();
}
function stopRecording() {
console.log('stopRecording');
speechToText.stopSpeechToText();
}
</script>
The Speech-To-Text Toolkit can do speech-to-text on the device, using the users GPU with a fallback to the CPU. This does mean that you use more of the users device resources, and depending on the device, execution may be slower. However, this also means that your speech never leaves the users device. To use local transcription, set up like the following:
<!-- this will do speech-to-text locally on your device, see below this code block for more examples -->
<speech-to-text localOrCloud="local">
<button id="start-button">Start</button>
<button id="stop-button">Stop</button>
</speech-to-text>
<speech-to-text localOrCloud="cloud" apiKey="your api key" region="your region, such as westus">
<button id="start-button">Start</button>
<button id="stop-button">Stop</button>
</speech-to-text>
The component will now use the Azure Speech SDK for Speech-To-Text transcription. Note, this will incur a cost as the docs linked to above discuss.
The Speech-To-Text Web toolkit can also decide automatically to do the transcription in the cloud or locally. To enable this, set up like the following:
<speech-to-text localOrCloud="automatic" apiKey="your api key" region="your region, such as westus">
<button id="start-button">Start</button>
<button id="stop-button">Stop</button>
</speech-to-text>
will run locally if the users device has more than 4GB of RAM, and has a battery level over 50%. Otherwise, transcription will happen in the cloud.
FAQs
A web component that a developer can use to enable accurate speech-to-text, either locally or in the cloud, in their web-based application, including a WebView.
The npm package speech-to-text-toolkit receives a total of 0 weekly downloads. As such, speech-to-text-toolkit popularity was classified as not popular.
We found that speech-to-text-toolkit 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
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.