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

ttsreader

v1.0.27

Published

Text to Speech wrapper, player and helpers for the web-speech-api speech synthesis

Downloads

1,688

Readme

ttsreader is a Text to Speech wrapper, reader / player and helpers for the web-speech-api speech synthesis

See published npm package https://www.npmjs.com/package/ttsreader

It is the engine behind the popular ttsreader.com online text & website reader , as well as:

Import:

To use in your own html / js code use one of the following methods:

  • <script src="https://unpkg.com/ttsreader/build/bundle.min.js"></script>
  • Or - download the following built file /build/bundle.min.js and use directly in your code <script src="bundle.min.js"></script>
  • Or - for Node based projects: npm i ttsreader

How to use?

See 'test.html' for a complete example.

The tts engine itself:

let tts = wsGlobals.TtsEngine; OR import {TtsEngine} from "tts-engine"

See test.html for real example on use. test.html

Tests Documentation

Since there are so many different platfrom-browser combos, we have to carefully test on each. Documentation bout it is here: TESTS.md

Showcases

This is used on the following sites:

TODOs:

  • Utils to 'cut' large texts into smaller sections.
  • Generic Player with UI, with options to play
    • text
    • element and its contents

How to contribute & publish updates to this package?

  • This package is published both on GitHub and on npmjs:
    • https://www.npmjs.com/package/ttsreader
    • https://github.com/RonenR/ttsreader
  • To publish an updated version - simply run npm publish, it will commit & push updates both to github and npm.

Important practical non-obvious lessons we learned about tts:

  1. You cannot send too many chars to REMOTE tts voice. It jams. Probably - the whole text is processed at once, and some mp3 is generated on the server?
    1. 38,000 is too much. It basically never starts.
    2. Local voices (at least on mac) worked well.
  2. With Google's voices - they will use the correct voice only sometimes. It's not consistent at all! (On Mac.) // TODO: Test on Windows!
    1. Solution: If you send a single utterance - it reads with a consistent voice.
    2. Problem: if they get the wrong voice - it will mess up reading for a large portion of the text...
    3. Sent google a bug report: https://bugs.chromium.org/p/chromium/issues/detail?id=1344469
  3. onboundary does not work with Google voices. So - we have to send small chunks anyhow...
  4. Of course - the famous google voice terminating itself after some circa 15 secs...