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 🙏

© 2025 – Pkg Stats / Ryan Hefner

audiotee-mic

v0.0.1

Published

AudioTee.js captures your Mac's system audio output and emits it as PCM encoded chunks at regular intervals. It's a tiny Node.js wrapper around the underlying [AudioTee](https://github.com/makeusabrew/audiotee) swift binary, which is [bundled](./bin) in t

Readme

AudioTee.js

AudioTee.js captures your Mac's system audio output and emits it as PCM encoded chunks at regular intervals. It's a tiny Node.js wrapper around the underlying AudioTee swift binary, which is bundled in this repository and distributed with the package published to npm.

About

AudioTee is a standalone swift binary which uses the Core Audio taps API introduced in macOS 14.2 to 'tap' whatever's playing through your speakers and emit it to stdout. AudioTee.js spawns that binary as a child process and forwards stdout as data events.

Basic usage

import { AudioTee, AudioChunk } from 'audiotee'

const audiotee = new AudioTee({ sampleRate: 16000 })

audiotee.on('data', (chunk: AudioChunk) => {
  // chunk.data contains a raw PCM chunk of captured system audio
})

await audiotee.start()
// ... later
await audiotee.stop()

Unless otherwise specified, AudioTee will capture system audio from all running processes.

Installation

npm install audiotee

Installation will download a prebuilt universal macOS binary which runs on both Apple and Intel chips, and weighs less than 600Kb.

Options

The AudioTee constructor accepts an optional options object:

interface AudioTeeOptions {
  sampleRate?: number // Target sample rate (Hz), default: device default
  chunkDuration?: number // Duration of each audio chunk in seconds, default: 0.2
  mute?: boolean // Mute system audio whilst capturing, default: false
  includeProcesses?: number[] // Only capture audio from these process IDs
  excludeProcesses?: number[] // Exclude audio from these process IDs
}

Option details

  • sampleRate: Converts audio to the specified sample rate. Common values are 16000, 44100, 48000.
  • chunkDuration: Controls how frequently data events are emitted. Smaller values = more frequent events with smaller chunks. Specified in seconds
  • mute: When true, system audio is muted whilst AudioTee is capturing
  • includeProcesses: Array of process IDs to capture audio from (all others filtered out)
  • excludeProcesses: Array of process IDs to exclude from capture

Events

AudioTee uses an EventEmitter interface to stream audio data and system events:

// Audio data events
audiotee.on('data', (chunk: { data: Buffer }) => {
  // Raw PCM audio data - mono channel, 32-bit float or 16-bit int depending on conversion
})

// Lifecycle events
audiotee.on('start', () => {
  // Audio capture has started
})

audiotee.on('stop', () => {
  // Audio capture has stopped
})

// Error handling
audiotee.on('error', (error: Error) => {
  // Process errors, permission issues, etc.
})

// Logging
audiotee.on('log', (message: string, level: LogLevel) => {
  // System logs from the AudioTee binary
  // LogLevel: 'metadata' | 'stream_start' | 'stream_stop' | 'info' | 'error' | 'debug'
})

Event details

Note: a bug in versions up to 0.0.2 means only the data lifecycle event is actually currently emitted.

  • data: Emitted for each audio chunk. The data property contains raw PCM audio bytes
  • start: Emitted when audio capture begins successfully
  • stop: Emitted when audio capture ends
  • error: Emitted for process errors, permission failures, or system issues
  • log: Emitted for all system messages from the underlying AudioTee binary

Requirements

  • macOS >= 14.2

API stability

During the 0.x.x release, the API is unstable and subject to change without notice.

Best practices

  • Always specify a sample rate. Tell AudioTee what you want, rather than having to parse the metadata message to see what you got from the output device
  • Specifying any sample rate automatically switches encoding to use 16-bit signed integers, which is half the byte size compared to the 32-bit float the stream probably uses natively
  • You'll probably need to specify a different chunkDuration depending on your use case. For example, some ASRs are quite particular about the exact length of each chunk they expect to process.

License

The MIT License

Copyright (C) 2025 Nick Payne.