Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@lephenix47/speech-to-text-utility
Advanced tools
Introducing the @lephenix47/speech-to-text-utility
library, a powerful and flexible solution designed for JavaScript and TypeScript developers looking to integrate speech recognition features into their projects. Built with simplicity and extensibility in mind, this library harnesses the power of the browser's Web Speech API to transcribe real-time audio inputs with ease.
To begin, you'll need to import the library into your project:
import { SpeechToText } from '@lephenix47/speech-to-text-utility';
From here, you can personalize the speech recognition behavior to fit your application's demands. Some notable methods worth mentioning include setting the language, enabling interim results, limiting the number of alternatives, toggling continual recognition, and configuring event callbacks.
Example:
const speechToText = new SpeechToText();
speechToText
.setLanguage('en-US')
.setInterimResults(true)
.setMaxAlternatives(5)
.setContinuous(true)
.setOnResult((sentence, isFinal) => {
if (isFinal) {
console.log(`Received Final Result: "${sentence}"`);
} else {
console.log(`Received Intermediate Result: "${sentence}"`);
}
});
Ready to embark on recognizing speech? Trigger the speech recognition engine with the startRecognition() method.
speechToText.startRecognition();
Should you ever decide to halt the recognition midway, rely on the handy stopRecognition() method.
speechToText.stopRecognition();
Method | Description | Return Value |
setLanguage(language: string) | Sets the language for the speech recognition. | SpeechToText |
setInterimResults(bool: bool) | Determines if interim results are included in the recognition. | SpeechToText |
setMaxAlternatives(num: number) | Limits the number of recognition alternatives offered. | SpeechToText |
setContinuous(bool: bool) | Switches on or off the continuous speech recognition mode. | SpeechToText |
setOnResult(fn: Function) | Registers a callback function invoked whenever a speech recognition result occurs. | SpeechToText |
setOnEnd(fn: Function) | Subscribes to the speech recognition ending event. | SpeechToText |
setOnError(fn: Function) | Signs up for the speech recognition error event. | SpeechToText |
setOnStart(fn: Function) | Hooks into the speech recognition initialization event. | SpeechToText |
setOnAudioStart(fn: Function) | Captures the audio capturing commencement event. | SpeechToText |
setOnSoundStart(fn: Function) | Monitors the audio's sonic occurrences triggering the fn callback. | SpeechToText |
setOnSoundEnd(fn: Function) | Observes the conclusion of auditory happenings invoking the fn callback. | SpeechToText |
setOnSpeechStart(fn: Function) | Seizes the moment when vocalizations ignite the fn callback. | SpeechToText |
setOnSpeechEnd(fn: Function) | Records the culmination of verbal articulations summoning the fn callback. | SpeechToText |
setOnNoMatch(fn: Function) | Documents the absence of a match incited by the fn callback. | SpeechToText |
startRecognition() | Commences speech recognition processing. | Promise<void> |
stopRecognition() | Terminates ongoing speech recognition activity. | Promise<void> |
get maxAlternatives() | Retrieves the maximum number of recognition alternatives. | number |
get continuous() | Obtains the status of continuous speech recognition. | boolean |
Integrating speech recognition into your projects has never been simpler, courtesy of the @lephenix47/speech-to-text-utility
library. Benefit from hassle-free integration, robustness, and extensive customizability today! Should you require any assistance or contribute, head over to GitHub and join the community.
Don't hesitate to leave a star rating or review to express appreciation for this open-source endeavor. Happy coding!
FAQs
description
The npm package @lephenix47/speech-to-text-utility receives a total of 3 weekly downloads. As such, @lephenix47/speech-to-text-utility popularity was classified as not popular.
We found that @lephenix47/speech-to-text-utility 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.