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

@sonoba/voice-client

v0.1.1

Published

Voice Pipeline SDK — WebSocket, VAD, audio playback

Downloads

244

Readme

@sonoba/voice-client

npm license

日本語特化 Voice Pipeline の Core SDK。WebSocket 接続・クライアントサイド VAD(Silero)・音声再生をワンパッケージで提供します。


インストール

npm install @sonoba/voice-client

クイックスタート

import { SonobaVoiceClient } from '@sonoba/voice-client';

const client = new SonobaVoiceClient({
  serverUrl: 'wss://your-server.com/ws',
});

client.on('transcript:user', ({ text }) => console.log('あなた:', text));
client.on('transcript:agent', ({ text }) => console.log('AI:', text));
client.on('status:change', (status) => console.log('状態:', status));

await client.connect();

オプション

const client = new SonobaVoiceClient({
  serverUrl: 'wss://your-server.com/ws',  // 必須

  vad: true,               // クライアントサイド VAD(デフォルト: true)
  vadModelUrl: '/silero_vad.onnx',         // VAD モデルのパス
  halfDuplex: true,        // TTS 再生中は VAD を無視(デフォルト: true)
  bargeInThreshold: 400,   // 割り込みまでの閾値 ms(デフォルト: 400)

  reconnect: {
    maxRetries: 5,
    minDelay: 1000,
    maxDelay: 10000,
  },
});

メソッド

| メソッド | 説明 | |---------|------| | connect(config?) | サーバーに接続。マイク・VAD・音声再生を初期化 | | disconnect() | 切断 | | setMuted(muted) | マイクのミュート切り替え | | sendText(text) | テキストをサーバーに送信 | | bargeIn() | TTS 再生を中断して割り込み |


イベント一覧

client.on('status:change', (status) => {});      // 接続状態の変化
client.on('transcript:user', ({ text }) => {});  // ユーザー発話の認識結果
client.on('transcript:agent', ({ text }) => {}); // AI の返答テキスト
client.on('audio:tts_start', (data) => {});      // AI 音声再生開始
client.on('audio:tts_end', (data) => {});        // AI 音声再生終了
client.on('vad:start', () => {});                // 発話開始検出
client.on('vad:end', () => {});                  // 発話終了検出
client.on('mic:muted', (muted) => {});           // ミュート状態変化
client.on('error', (err) => {});                 // エラー

ライセンス

MIT © sonoba