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

dictation_support

v1.0.4

Published

SDK to interact with dictation devices

Downloads

11,909

Readme

Dictation support SDK

Features

The SDK provided with this repository allows web-based apps/pages to interact with dictation devices:

  • Events for connected / disconnected devices
  • Events for button presses / slider movements
  • Events for motion events (pickedup and layed down)
  • Commands to set LED states (predefined states or individual LED settings)

Demo website

You can test out the SDK capabilities with a supported device using this demo website.

TODO: host latest release and link here

Supported devices

| Dictation microphones | Foot controls | |:-----------------------------------------|:----------------| | Philips SpeechMike Premium LFH3500 | Philips ACC2310 | | Philips SpeechMike Premium LFH3510 | Philips ACC2320 | | Philips SpeechMike Premium LFH3520 | Philips ACC2330 | | Philips SpeechMike Premium LFH3600 | | | Philips SpeechMike Premium LFH3610 | | | Philips SpeechMike Premium Touch SMP3700 | | | Philips SpeechMike Premium Touch SMP3710 | | | Philips SpeechMike Premium Touch SMP3720 | | | Philips SpeechMike Premium Touch SMP3800 | | | Philips SpeechMike Premium Touch SMP3810 | | | Philips SpeechMike Premium Air SMP4000 | | | Philips SpeechMike Premium Air SMP4010 | | | Philips SpeechOne PSM6000 | | | Nuance PowerMic III | | | Nuance PowerMic 4 | |

Supported platforms

  • Google Chrome on Windows, macOS, Linux and Chrome OS (Chromebooks)
  • Microsoft Edge on Windows and macOS

Note

If your browser runs remotely (e.g. Citrix Virtual Apps and Desktops, VMware Horizon...) you need to have the dictation device buttons redirected on USB level. Please follow documentation provided by the virtualization platform vendors.

How to use

Sample usage

NPM package

Link to package

Run npm install dictation_support --save-dev to install the package as dependency and then use as

import { DictationDevice, ButtonEvent, DictationDeviceManager } from 'dictation_support';

const manager = new DictationDeviceManager();
// Your code here

Include compiled sdk

To use the SDK, simply include the compiled index.js into your web page/app and create an instance of DictationSupport.DictationDeviceManager. See /example/index.ejs or the resulting /dist/index.html for an example.

WebHID permission / policy

The SDK requires permission to interact with the device using the WebHID API. This can happen two different ways:

User grants permission

You can use await deviceManager.requestDevice(), which will prompt the user to select one of the supported devices from a pop-up. Once the user has granted permission, the device will be available, i.e. a new DictationDevice will be created. That device will also be available via deviceManger.getDevices() when the page reloads. Disconnecting and reconnecting the device will require the user to grant permission again using deviceManager.requestDevice().

Admin grants permission

TODO(Google): surface WebHidAllowAllDevicesForUrls to the admin console (ETA: 2022Q4)

Instead of the user being prompted to grant permissions, the admin can also grant permissions upfront.

On the Google admin console, navigate to the user or managed guest session policy page and search for WebHidAllowAllDevicesForUrls. With this setting, you can allowlist certain devices (vendor ID & product ID) to the URLs you want to use the SDK on. Note: The Philips SpeechMikes have different product IDs depending on the event mode (HID vs browser/gamepad mode), see /src/device_manager.ts for a list of supported product and vendor IDs (in hex format) in various modes. The product and vendor ID for the policy have to be provided in decimal representation.

If the device is granted permission via policy, the device will be available to the SDK immediately when it is connected (also firing an event).

Developer instructions

Installation

In order to get started developing, run npm install to install the required dependencies.

Build

To build the SDK, run npm run build, which will create the following set of files

  • /dist/index.js the SDK you need to include
  • /dist/index.d.ts Typescript typings for the SDK
  • /dist/index.html sample page using the SDK

Contributing

Feel free to send pull-requests! All code changes must be:

  • approved by a project maintainer
  • pass linting (use npm run lint)
  • be properly formatted (use npm run format or npm run formatCheck)
  • pass tests (use npm test)