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

simple-speak

v1.3.2

Published

Quickly add text-to-speech widgets to HTML, using the Web Speech API.

Downloads

13

Readme

Build status — Travis-CI simple-speak on Npmjs js-semistandard-style License Total downloads ~ NPMJS.com Size of Javascript Browserify embed me

nfreear / simple-speak

Quickly add text-to-speech widgets to HTML, using the Web Speech API.

A powerful, straightforward Javascript wrapper around the Web Speech API in the browser. Zero-configuration speech synthesis / text-to-speech (TTS) (... with plenty of configuration potential if you need it).

Web browser compatibility:

  • Compatible ~ recent Chrome, Firefox, Safari and Microsoft Edge,
  • Not compatible ~ MS Internet Explorer.

Read the blog post. Suggest features and uses .. (An original Gist.)

Features

  • An arbitrary HTML element or form field can be used as speeech input,
  • Simple Javascript and <iframe> embeds,
  • Speak and spell modes,
  • Supports all the voices and languages your Web browser supports.

See the release notes.

Install and test

Build with Browserify:

npm install
npm run build
npm test

Usage

Use Javascript hosted on the unpkg CDN:

<div id="id-simple-speak"> Hello. I'm simple-speak. </div>

<script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></script>
<script src="https://unpkg.com/[email protected]#._.js"></script>

Use Javascript hosted on the RawGit CDN:

<div id="id-simple-speak"> Hello. I'm simple-speak. </div>

<script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></script>
<script src="https://cdn.rawgit.com/nfreear/simple-speak/1.3.2/build/simple-speak.js"></script>

Speak static text within an arbitrary HTML <element> — zero-configuration:

<div id="id-simple-speak"> Hello. I'm simple-speak. </div>

<script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></script>
<script src="dist/simple-speak.js"></script>

Speak a text form-field, configure an alternative voice (configuration):

<label>Speech input <input id="id-simple-speak" value="Hi. I'm a text input box!"></label>

<script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></script>
<script src="dist/simple-speak.js" data-simple-speak='{ "voiceFamily": "Vicki" }'></script>

Localized

Simplified Chinese — Hello auntie:

<div id="id-simple-speak"> 你好阿姨 </div>

<script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></script>
<script src="dist/simple-speak.js"
        data-simple-speak='{ "lang": "zh-cn", "voiceFamily": "Google 普通话(中国大陆)" }'></script>

Spell

<div id="id-simple-speak"> Spell me! </div>

<script src="https://unpkg.com/[email protected]/dist/jquery.min.js"></script>
<script src="dist/simple-speak.js" data-simple-speak='{ "mode": "spell" }'></script>

Events

Listen for the speak.simpleSpeak, and Web Speech API events, for example, onboundary:

$('#id-simple-speak').on('speak.simpleSpeak', function (ev, utterance, config) {
  console.warn('speak: ', ev, utter, config);

  $(utterance).on('boundary', function (ev) {
    console.warn('boundary: ', ev);
  });
});

Iframe

You can embed simple-speak in an <iframe>, and optionally set a language:

<iframe
  aria-label="Speech synthesis"
  class="simple-speak-ifr" width="100%" height="75"
  src="https://cdn.rawgit.com/nfreear/simple-speak/1.3.2/embed/?lang=fr;q=Bonjour"></iframe>

WordPress

A shortcode plugin for WordPress to speak and spell:

[speak] Hello [/speak]   ..   [spell] Spell me! [/spell]

License

License: MIT.

© 2017 Nick Freear and contributors. @nfreear.