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 🙏

© 2026 – Pkg Stats / Ryan Hefner

webvoice

v0.0.4

Published

a web voice solution for browser

Readme

webvoice

一个网页语音对讲库。

使用

npm install webvoice --save

设计

采集

  1. 通过MediaDevices.getUserMedia()进行语音采集
  2. 需要在https的环境下调用
  3. 把麦克风数据塞给 MediaStreamAudioSourceNode

编码

  1. 建立ScriptProcessNode处理节点
  2. 把建立的 MediaStreamAudioSourceNode 连接到 ScriptProcessNode 然后连接到 AudioContext.destination
  3. ScriptProcessNodeonaudioprocess 事件中处理 Buffer
  4. Buffer 进行压缩和 wav 编码

传输

  1. 通过websocket加密方式进行传输

处理

  1. 任意后台进行数据处理 node/java/c#/c++
  2. 然后转发到目的地
  3. 把结果通过websocket发送出来

接收

  1. 通过websocket进行接收

解码

  1. 通过 AudioContextdecodeAudioData 方法对 wav 格式音频文件解码

播放

  1. 构建AudioBufferSourceNode节点
  2. 连接到 AudioContext.destination 并进行播放

Document

API

音频格式浏览器支持情况

|内容\浏览器|Chrome|IE|FireFox|Safari|Opera| |---|---|---|---|---|---| |<audio>|4.0|9.0|3.5|4.0|10.5| |mp3|Y|Y|Y|Y|Y| |wav|Y|N|Y|Y|Y| |ogg|Y|N|Y|N|Y|

媒体类型

|文件类型|媒体类型|文件大小| |---|---|---| |mp3|audio/mpeg|| |ogg|audio/ogg|| |wav|audio/wav|1B=取样频率x量化位数x声道x时间/8|

声音参数

|类型|值范围| |---|---| |量化位数|8位、16位、24位| |取样频率|11025Hz(11kHz)、22050Hz(22kHz)、44100Hz(44kHz)| |声道|单声道(nx1矩阵点)、立体声(nx2矩阵点)|

参考资料

网页音频接口的基本概念