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

glove-voice-native

v0.2.0

Published

React Native / Expo audio backends for the Glove voice pipeline — on-device mic capture, PCM playback, and Silero VAD

Downloads

321

Readme

glove-voice-native

React Native / Expo audio backends for the Glove voice pipeline.

glove-voice's pipeline — VAD, speech gating, STT/TTS adapters, barge-in, narration — is platform-neutral. Only the edges touch the platform: the microphone and the speaker. This package supplies those edges for iOS and Android:

  • NativeAudioCapture — on-device mic capture (Int16 mono PCM chunks), backed by react-native-audio-api's AudioRecorder. Configures the iOS audio session for full-duplex voice chat (playAndRecord + voiceChat mode → OS echo cancellation), requests permissions, converts to the pipeline format.
  • NativeAudioPlayer — gapless streaming PCM playback via react-native-audio-api's Web Audio implementation.
  • SileroVADNativeAdapter (glove-voice-native/silero-vad) — Silero VAD v5 running on onnxruntime-react-native, with the same confirmed-speech lifecycle (speech_start / speech_real_start / vad_misfire / speech_end / speech_prob) as the browser adapter — so speech gating and noise-robust barge-in work identically on-device.

Install

npx expo install react-native-audio-api
pnpm add glove-voice glove-voice-native

# Optional — neural VAD (recommended) + model caching:
pnpm add onnxruntime-react-native
npx expo install expo-file-system

These are native modules — they work in an Expo dev client / expo prebuild build, not in Expo Go:

npx expo prebuild && npx expo run:ios   # or run:android

Expo config

Use react-native-audio-api's config plugin for the mic permission:

// app.json
{
  "expo": {
    "plugins": [
      [
        "react-native-audio-api",
        {
          "iosMicrophonePermission": "This app uses the microphone to talk to the assistant.",
          "androidPermissions": [
            "android.permission.RECORD_AUDIO",
            "android.permission.MODIFY_AUDIO_SETTINGS"
          ]
        }
      ]
    ]
  }
}

Usage

Everything from the web voice stack carries over — the only change is audio in the voice config (and the native Silero adapter):

import { useGlove } from "glove-react";
import { useGloveVoice } from "glove-react/voice";
import { createElevenLabsAdapters } from "glove-voice";
import { createNativeAudioIO } from "glove-voice-native";
import { SileroVADNativeAdapter } from "glove-voice-native/silero-vad";

const { stt, createTTS } = createElevenLabsAdapters({
  getSTTToken: () => fetchToken("https://your-server/api/voice/stt-token"),
  getTTSToken: () => fetchToken("https://your-server/api/voice/tts-token"),
  voiceId: "JBFqnCBsd6RMkjVDRZzb",
});

// Downloads + caches the Silero v5 model on first run (via expo-file-system).
// Bundle it yourself and pass a local path to skip the download.
const vad = new SileroVADNativeAdapter();
await vad.init();

function VoiceScreen() {
  const glove = useGlove({ endpoint: "https://your-server/api/chat", systemPrompt, tools });
  const voice = useGloveVoice({
    runnable: glove.runnable,
    voice: { stt, createTTS, vad, audio: createNativeAudioIO() },
  });

  return <Button title={voice.mode} onPress={voice.enabled ? voice.stop : voice.start} />;
}

Or with the convenience wrapper:

import { withNativeAudio } from "glove-voice-native";

const voice = useGloveVoice({
  runnable,
  voice: withNativeAudio({ stt, createTTS, vad }),
});

No neural VAD? Skip onnxruntime-react-native entirely — GloveVoice falls back to the built-in adaptive energy VAD from glove-voice (pure JS, runs anywhere). Speech gating still applies; you lose the tentative→confirmed noise filtering.

Push-to-talk (turnMode: "manual", useGlovePTT) works too — wire ptt.bind's pointer handlers to a Pressable.

Options

createNativeAudioIO({
  bufferLengthMs: 50,          // mic chunk size (latency vs CPU)
  requestPermissions: true,    // ask for mic permission in init()
  manageAudioSession: true,    // set + activate the shared audio session
  iosCategory: "playAndRecord",
  iosMode: "voiceChat",        // OS echo cancellation — keeps TTS out of the mic
  iosOptions: ["defaultToSpeaker", "allowBluetoothHFP"],
});

new SileroVADNativeAdapter({
  model: SILERO_V5_MODEL_URL,  // or a local file path
  positiveSpeechThreshold: 0.5,
  negativeSpeechThreshold: 0.35,
  redemptionMs: 1400,
  minSpeechMs: 250,
});

Notes

  • Sample rate: the pipeline default is 16 kHz mono — leave it unless your STT/TTS provider requires otherwise.
  • Auth: same token model as the web — your server exchanges the provider API key for short-lived tokens (createVoiceTokenHandler from glove-next, or any HTTP endpoint).
  • Hermes: the Silero adapter uses an int64 tensor (BigInt64Array) — use a recent React Native (0.74+) where Hermes ships BigInt typed arrays.
  • One recorder at a time: react-native-audio-api recommends a single AudioRecorder instance; GloveVoice creates one per start() and releases it on stop() — don't run two voice pipelines at once.