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

@voibo/desktop-media-capture

v2.1.10

Published

Desktop audio and video capture for Node.js

Readme

Desktop Media Capture

Native Node.js module for capturing desktop audio and video on macOS and Windows.

IMPORTANT: AudioCapture class is now deprecated. Please use MediaCapture instead, which provides both audio and video capture capabilities.

Features

  • Capture both audio and video from desktop screens and application windows
  • High-performance native implementation
  • Support for both macOS (Apple Silicon) and Windows
  • Electron application support
  • Event-based API for real-time processing

Installation

npm install @voibo/desktop-media-capture

Compatibility

  • macOS: Apple Silicon (ARM64) devices
  • Windows: 64-bit systems

Basic Usage

import {
  MediaCapture,
  MediaCaptureQuality,
  MediaCaptureTargetType,
} from "@voibo/desktop-audio-capture";

// Check if platform is supported
if (!MediaCapture.isSupported()) {
  console.error("MediaCapture is not supported on this platform");
  process.exit(1);
}

// Create a new capture instance
const capture = new MediaCapture();

// Set up event handlers
capture.on("video-frame", (frame) => {
  console.log(`Received video frame: ${frame.width}x${frame.height}`);
  // Process frame.data (Uint8Array) as needed
});

capture.on("audio-data", (audioData, sampleRate, channels) => {
  console.log(
    `Received audio data: ${audioData.length} samples, ${channels} channels at ${sampleRate}Hz`
  );
  // Process audioData (Float32Array) as needed
});

capture.on("error", (error) => {
  console.error("Capture error:", error);
});

// List available screen capture targets
const targets = await MediaCapture.enumerateMediaCaptureTargets(
  MediaCaptureTargetType.Screen
);
console.log("Available capture targets:", targets);

// Configure and start capture
capture.startCapture({
  displayId: targets[0].displayId, // First available display
  frameRate: 10, // Frames per second
  quality: MediaCaptureQuality.Medium,
  audioSampleRate: 44100,
  audioChannels: 2,
  isElectron: false, // Set to true for Electron apps
});

// Stop capture when done
setTimeout(async () => {
  await capture.stopCapture();
  console.log("Capture stopped");
}, 10000); // Capture for 10 seconds

API Reference

MediaCapture Class

Static Methods

  • MediaCapture.enumerateMediaCaptureTargets([type]): Returns a promise with an array of available capture targets
  • MediaCapture.isSupported(): Checks if MediaCapture is supported on the current platform

Instance Methods

  • startCapture(config): Starts capturing with the specified configuration
  • stopCapture(): Stops the current capture and returns a Promise

Events

  • 'video-frame': Emitted when a new video frame is available (JPEG format)
  • 'audio-data': Emitted when new audio data is available
  • 'error': Emitted when an error occurs
  • 'exit': Emitted when the capture process exits

Configuration Options

interface MediaCaptureConfig {
  frameRate: number; // Video frame rate
  quality: number; // Using MediaCaptureQuality enum (High/Medium/Low)
  // High=90%, Medium=75%, Low=50% JPEG quality on both platforms
  qualityValue?: number; // Precise JPEG quality value (0-100)
  // Overrides quality enum if specified (works on both platforms)
  audioSampleRate: number; // Audio sample rate in Hz
  audioChannels: number; // Number of audio channels
  displayId?: number; // ID of display to capture
  windowId?: number; // ID of window to capture
  bundleId?: string; // macOS bundle ID
  isElectron?: boolean; // Set to true for Electron apps
}

AudioCapture Class (DEPRECATED)

DEPRECATED: The AudioCapture class is deprecated and will be removed in a future version. Please use MediaCapture instead, which provides both audio and video capture capabilities with improved performance.

// ❌ Deprecated approach
import { AudioCapture } from "@voibo/desktop-audio-capture";
const audioCapture = new AudioCapture();

// ✅ Recommended approach
import { MediaCapture } from "@voibo/desktop-audio-capture";
const mediaCapture = new MediaCapture();

Known Issues

macOS Limitations

  • Capture Termination: On macOS, when focus is moved away from the screen being captured, both screen capture and desktop audio capture will be forcibly terminated. This is a limitation of the macOS ScreenCaptureKit framework and not a bug in the library.

License

MIT