![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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.
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.