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

@tilawi/expo-pcm-recorder

v0.1.0

Published

Minimal Expo module that streams mono float32 microphone PCM (e.g. 16 kHz) to JS in fixed-size chunks, for on-device speech recognition.

Readme

@tilawi/expo-pcm-recorder

A minimal Expo module that streams raw microphone audio to JavaScript as mono float32 PCM at the sample rate you ask for (e.g. 16 kHz), in fixed-size chunks. Built for on-device speech recognition, where you want samples rather than an encoded file.

It powers voice search and memorization checks in the Tilawi Quran app, together with @tilawi/react-native-quran-asr.

  • iOS: AVAudioEngine input tap, converted with AVAudioConverter. The audio session is set to .playAndRecord (Bluetooth allowed, mixes with and ducks other audio) and restored to its previous category when recording stops.
  • Android: AudioRecord from the MIC source, 16-bit PCM scaled to [-1, 1], with transient audio focus while recording.
  • Safe to import in a build that doesn't include the native code: isPcmRecorderAvailable is then false and nothing crashes.

Install

npx expo install @tilawi/expo-pcm-recorder

Then rebuild your development client (this module has native code; it doesn't work in Expo Go).

Microphone permission. This module doesn't request permission itself. Declare it and ask for it with another module that owns the same OS permission, for example expo-audio:

{ "plugins": [["expo-audio", { "microphonePermission": "Allow $(PRODUCT_NAME) to hear your recitation." }]] }
import { requestRecordingPermissionsAsync } from 'expo-audio';
await requestRecordingPermissionsAsync();

Usage

import {
  addPcmChunkListener,
  isPcmRecorderAvailable,
  startPcmRecording,
  stopPcmRecording,
} from '@tilawi/expo-pcm-recorder';

const chunks: number[][] = [];
const sub = addPcmChunkListener((samples) => chunks.push(samples)); // float32 in [-1, 1]

await startPcmRecording(16000, 100); // 16 kHz, one chunk every 100 ms
// ... later
await stopPcmRecording(); // remaining audio is delivered before this resolves
sub?.remove();

| API | | |---|---| | startPcmRecording(sampleRate, intervalMs) | Start capturing. Rejects if the permission is missing, the microphone is busy, or a recording is already running. | | stopPcmRecording() | Stop and flush the remaining audio. Safe to call when idle. | | addPcmChunkListener(fn) | Receive number[] chunks of mono samples. Returns a subscription (null when unavailable). | | isPcmRecorderAvailable | false when the native module isn't in the running binary. |

Android caveat: if the capture thread doesn't finish within 1 s of stopping (not observed in practice), a final chunk may arrive after stopPcmRecording() resolves.

Credits

Inspired by @siteed/audio-studio (MIT) by @deeeed; the native sources note which of its capture settings this module mirrors.

License

MIT