
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@raghavendra_kj/stt-js
Advanced tools
A wrapper around the Web Speech API for speech-to-text functionality.
You can view a live demo of the example here.
The Speech-to-Text (STT) library provides a clean interface for integrating browser-based speech recognition into your web applications using the Web Speech API. It supports real-time transcription, interim results, and continuous listening.
npm install @raghavendra_kj/stt-js
import { STT } from "@raghavendra_kj/stt-js";
const stt = new STT();
await stt.start();
You can also pass options:
await stt.start({
lang: "en-IN",
continuous: false,
interimResults: false
});
stt.stop(); // Gracefully ends recognition
stt.abort(); // Forcibly ends recognition
stt.onResult((text) => {
console.log("Final result:", text);
});
stt.onPartialResult((text) => {
console.log("Interim result:", text);
});
stt.onError((error) => {
console.error("Error occurred:", error);
});
stt.offResult(handler); // Remove a specific listener
stt.removeAllListeners(); // Remove all listeners
STT.start(options?)Starts speech recognition.
Parameters:
lang (string): Language code (default: "en-US")continuous (boolean): If recognition should continue after pauses (default: true)interimResults (boolean): Whether to include interim results (default: true)Returns: Promise<void>
STT.stop()Stops the recognition session gracefully.
STT.abort()Forcibly aborts the recognition session.
STT.isRecognizing()Returns a boolean indicating whether recognition is currently active.
STT.dispose()Stops recognition and removes all listeners. Use for cleanup.
stt.onStart(handler: () => void): Triggered when recognition starts.stt.onEnd(handler: () => void): Triggered when recognition ends.stt.onResult(handler: (text: string) => void): Triggered when a final transcript is available.stt.onPartialResult(handler: (text: string) => void): Triggered for interim transcript updates.stt.onError(handler: (error: STTError) => void): Triggered when an error occurs.stt.offStart(handler: () => void): Removes a specific "start" listener.stt.offEnd(handler: () => void): Removes a specific "end" listener.stt.offResult(handler: (text: string) => void): Removes a specific "result" listener.stt.offPartialResult(handler: (text: string) => void): Removes a specific "partialResult" listener.stt.offError(handler: (error: STTError) => void): Removes a specific "error" listener.stt.removeAllListeners(event?): Removes all listeners for a specific event or all events.If supported, the library uses the Permissions API to check for microphone access.
Errors are reported through the "error" events.
Ensure the target browser supports the Web Speech API (e.g., latest versions of Chrome, Edge).
A complete working example is available in example/index.html.
FAQs
A wrapper around the Web Speech API for speech-to-text functionality.
We found that @raghavendra_kj/stt-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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.