npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

voirexx

v1.1.4

Published

Voirex is a robust and useful wrapper of many Speect to Text (Voice Recognition) API. In addition to this, Voirex allows you to add dynamic commands to your web applications.

Downloads

18

Readme

Voirex

About Voirex

Voirex is a robust and useful wrapper of many Speect to Text (Voice Recognition) API. In addition to this, Voirex allows you to add dynamic commands to your web applications.

Actually, Voirex is a Speech to Function library which will updated and developed continuously. The main properties of Voirex;

  • Selecting various Voice Recogntion API you want to select
    • HTML5 Web Speech API
    • Google Sound Cloud
    • IBM Watson
    • etc.
  • Dynmaic and quick recognition of voice commands
  • Add commands easily
  • Create a dictation object to convert voice to text easily
  • Simulate some commands without microphone
  • Pause and resume command recognition
  • Text analysis with using Levenshtein Distance Algorithm
  • Prefering the language which you want
  • Taking object property as function and running according to similarity of VoiceText and keywords which you want
  • Ability to work with different Javascript environments(Vanilla.js, Node.js, ES6, ES5 etc.)

Installation

NPM
  npm install voirexx

Or just download a .zip package and with the source code, minified file and commands examples with React.js.

How to use

Voirex is totally written in ES6, but it can be transpiled on every version to Javascript. Manager.js cover the main class of Voirex. And all of them converted to ES5 codes under the dist folder.

    dist
        |
        --voice-assistant.umd.js -
        |
        --voice-assistant.cjs.js -
        |
        --voice-assistant.esm.js -
        

If you import Voirex into your we application projects, you can use this codes,

import Voirex from 'voirexx';

let recognition = new Voirex(
  {
    type: 'browserDefault',
    lang: 'tr-TR'
  },
  {
    keyword: ['Hi', 'Hello'],
    func: myfunc,
    accuracy: '52%',
    pref: 'max'
  }
);

Explanation of above code:

Voice Type

type: 'browserDefault': the which recognition API you want select

lang: 'tr-TR' : Language you want to select

Command

keyword: ['Hi', 'Hello']: keywords which analyze with voice text

func: myfunc: function which you want to do

accuracy: '52%': over which accuracy of analysis function run

pref: 'max': If there are keywords more than one, as which one voirex run

Basic Usage

With using Voirex Speech to function API, adding command is so easy.

//importing voirex
import Voirex from 'voirexx';

//creating a voirex object to start the recognition
let recognition = new Voirex(
  {
    type: 'browserDefault',
    lang: 'tr-TR'
  },
  {
    keyword: ['Hi', 'Hello'],
    func: myfunc,
    accuracy: '52%',
    pref: 'max'
  }
);


//setting a new recognition 
let new_reco = recognition.setVoiceRecConfig();

//start the recognition
recognition.startRecognition(new_reco);

//stop the recognition 
recognition.stopRecognition(new_reco);

//getting instruction of voice (Voice Text)
new_reco.onresult = (event) => {
    recognition.resultProcessVoiceRecog(recognition.getVoiceText(event));
}

With the above code you can;

  • do Dynamic Voice Recognition by selecting one of Voice Recognition APIs which integrated with Voirex,
  • analyze the similarity of voice text and your keywords with Levenshtein Distance Algorithm like {hi: '35.252365', hello: '80.5562255'}
  • compare your accuracy and levenshtein accuracy, according to the result you can run the func
  • get the voice text

As I mentioned above, you can easily install and import Voirex and with very little row code you can embed your web app.

Advanced Methods of Voirex

getAPIInfo(): All the information about you selected Voice Recognition Type

console.log(recognition.getAPIInfo());

    $ >  
        /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
            /*/*/*/DEFAULT BROWSER VOICE RECOGNITION/*/*/*/*
            /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*

           "Interim Results": mutable (default false) \n\n
           "Maximum" Alternatives: mutable (default 1) \n\n
           "Lang" : mutable (default meta charset) \n\n
           
           { 
            "Afrikaans": [
              ["South Africa", "af-ZA"]
            ],
            "Arabic" : [
              ["Algeria","ar-DZ"],
              ["Bahrain","ar-BH"],
              ["Egypt","ar-EG"],
              ["Israel","ar-IL"],
              ["Iraq","ar-IQ"],
              ["Jordan","ar-JO"],
              ["Kuwait","ar-KW"],
              ["Lebanon","ar-LB"],
              ["Morocco","ar-MA"],
              ["Oman","ar-OM"],
              ["Palestinian Territory","ar-PS"],
              ["Qatar","ar-QA"],
              ["Saudi Arabia","ar-SA"],
              ["Tunisia","ar-TN"],
              ["UAE","ar-AE"]
            ],
            "Basque": [
              ["Spain", "eu-ES"]
            ],
            "Bulgarian": [
              ["Bulgaria", "bg-BG"]
            ],
            ...
   

checkingVoiceApi(): Check the Voice Selected API you selected is integrated with Voirex or not

console.log(recognition.checkingVoiceApi())

    $> true

checkActualAccuracy(voiceText): Get the Levenshtein distance between keywords and Voice Recognition Text

console.log(recognition.checkActualAccuracy(recognition.getVoiceText(event)))

    $> {hi: '81.54654654', hello: '12.252156'}

checkMax(voiceText): Taking maximum distance percentage of keywords Levenshtein Accuracy

console.log(recognition.checkMax(voiceText))

    $> 81.256256

checkMin(voiceText): Taking minimum distance percentage of keywords Levenshtein Accuracy

console.log(recognition.checkMin(voiceText))

    $> 81.256256

checkingVoiceText(voiceText): Check the voice text is emptyor not

console.log(recognition.checkingVoiceText(voiceText))

    $> 'voiceText'

Warning

* All the error related between developer and Voirex return -1. Developers can check their code error with this way.

For Example

If the browser does not support Voirex, setVoiceRecConfig() method return then, if you use a uncommon browser, you can check the browser support feature by writing the value of setVoiceConfig() method.