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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@aizhushou/webspeech

v1.0.3

Published

browser web speech api wrapper

Readme

基于web speech api的响应式封装

Web Speech API是一个浏览器API,允许网页进行语音识别(ASR)和语音合成(TTS)。它分为两个部分:语音识别(Speech Recognition)和语音合成(Speech Synthesis)。本项目提供了对这两个功能的响应式封装,方便在Vue 3中使用。

1、TTS语音合成

const speechOutput =  useSpeechSynthesis();
speechOutput.speek('Hello, world!'); // 语音合成
speechOutput.pause(); // 暂停
speechOutput.resume(); // 恢复
speechOutput.cancel(); // 取消
speechOutput.toggle(); // 切换暂停/恢复

console.log(speechOutput.isSupported); // 是否支持语音合成
console.log(speechOutput.isInactive); // 是否处于非活动状态
console.log(speechOutput.isSpeaking); // 是否正在说话
console.log(speechOutput.isPaused); // 是否暂停
console.log(speechOutput.status); // 语音合成状态
console.log(speechOutput.error); // 错误信息

2. ASR语音识别

注意:Chrome浏览器需要科学上网才能使用语音识别功能。

const speechInput = useSpeechRecognition();
speechInput.start(); // 开始语音识别
speechInput.stop(); // 停止语音识别
speechInput.toggle(); // 切换开始/停止

console.log(speechInput.isSupported); // 是否支持语音识别
console.log(speechInput.isInactive); // 是否处于非活动状态
console.log(speechInput.isListening); // 是否正在监听
console.log(speechInput.content); // 识别的内容
console.log(speechInput.interimContent); // 临时识别的内容
console.log(speechInput.status); // 语音识别状态
console.log(speechInput.error); // 错误信息