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

yami-voice

v0.1.1

Published

使用 **SoundTouch** 提供的变声核心逻辑,通过 **audioContenxt** 将音频资源、音频文件或音频流进行实时变声处理。

Downloads

6

Readme

Yami

使用 SoundTouch 提供的变声核心逻辑,通过 audioContenxt 将音频资源、音频文件或音频流进行实时变声处理。

本库 wsola 算法以及插值算法借鉴了 SoundTouchJS 中的实现,与 SoundTouchJS 相比本库的优点在于:

  • 1.支持 Typescript
  • 2.支持原生 ESM
  • 3.支持麦克风设备实时变声
  • 4.接口更简洁

缺点在于:

  • 1.不支持变速

由于使用 ScriptProcessorNode 的音频数据输入进行实时变声处理,所以不支持变速功能,如果需要使用到变速功能并且不使用音频流,可以使用 SoundTouchJS

安装

NPM

yarn add yami-voice

CDN

<script src="https://cdn.jsdelivr.net/gh/yydounai1234/Yami/dist/Yami.umd.cjs"></script>
<script>
    // ...
</script> 

ESM

<script type="importmap">
  {
    "imports": {
      "Yami": "https://cdn.jsdelivr.net/gh/yydounai1234/Yami/dist/Yami.cjs"
    }
  }
</script>
<script type="module">
    // ...
</script> 

使用方法

  • 初始化类库
const yami = new Yami()
  • 创建音频轨
// 根据 url 地址创建音频轨
const urlTrack = await yami.createURLTrack('/test.mp3')

// 根据 buffer 创建音频轨
const fileBuffer = new ArrayBuffer()
const bufferTrack = await yami.createBufferTrack(fileBuffer)

// 创建设备麦克风输入的音频轨
const microphoneTrack = await yami.createMicrophoneTrack()
  • 设置变调参数
track.pitch = 0.7
  • 开始播放
track.play()

使用文档

具体的使用文档指南可以查看 Yami

DEMO

  • 下载源码
git clone [email protected]:yydounai1234/Yami.git
yarn install
yarn dev

LICENSE

由于部分代码借鉴了 SoundTouchJS,其采用了 LGPL,故本库也采用 LGPL 协议。