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

talkr-tts

v0.0.2

Published

Wraps speechSynthesis calls for applications that want to animate to the voice

Downloads

3

Readme

talkr-tts

talkr-tts wraps speechSynthesis calls with a framework that helps animate something to the voice. An attempt is made to estimate the duration of the speech. Events are emitted by the Scene class to communicate when a Face is speaking, and for how long it will speak for.

Classes

Utterance

An utterance is the smallest unit of speech. There should be no pauses in an utterance, so a phrase with a comma in it should be split into two utterances. An utterance has a pitch, rate, and a delay. Only local TTS voices, (as opposed to cloud-based ones by google) can change pitch and rate.

Voice

A voice is a TTS voice. It has a locale ('en-US', or 'ru-RU'), a gender, and a voice preference. Different operating systems and browsers will have access to different voices, so the voice preference will only be selected if it exists (even if the locale or gender doesn't match). If the voice preference is an integer i, we'll use the i'th voice that matches the locale and gender. Partial locales are supported, so 'en' will consider all English voices, including those from the US, UK and other locations.

Face

A face consists of a Voice and an id. The id is commonly a URL to something that will animate.

Clip

A clip is one or more utterances that are spoken consecutively by a Face.

Scene

A scene contains one or more clips that are spoken consecutively, potentially by different Faces. Scenes handles playing back the clips and emitting events including:

'clipstart' : Notifies you when a new clip is starting. Passes you the clip object. This is normally a good time to change the currently visible character based on the face property of the clip.

'utterancestart': Notifies you when a new utterance starts. Passes you an object with a duration and a face keys. The duration is an estimate for how long the utterance will play. The face is the face object that is playing the utterance.

'scenefinished': Notifies you when the scene has finished playing.

iOS restrictions

iOS only allows text-to-speech to be initiated by the user. So calling the playClips() function of the Scene object should only be done by user-initiated events (a click or a tap) if you want it to work on all mobile devices. In most cases, all of the clips and utterances will play, but utterance delays of sufficient magnitude may invalidate the user-initiated event with respect to the utterance.