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

expo-video-audio-extractor

v0.1.0

Published

On-device audio extraction from video files in Expo & React Native apps without ffmpeg.

Readme

Expo Video Audio Extractor

npm version License: MIT

On-device audio-only export for React-Native & Expo

No FFmpeg • No GPL • Just the platform media APIs — AVAssetExportSession (iOS) & MediaExtractor / MediaMuxer / MediaCodec (Android)

Table of Contents

Features

  • Offline – runs entirely on-device, no upload required
  • Clean audio export – grab the soundtrack from any local video
  • Trim & resample – optional start / duration, sample-rate & channel overrides
  • M4A / WAV output – lightweight presets accepted everywhere
  • Classic & New Architecture – works if the host app opts into TurboModule/Fabric later

Installation

Supported React-Native versions: 0.79 (Expo SDK 53). Older versions may compile but are not tested.

npx expo install expo-video-audio-extractor

That’s it — run a development build or EAS production build and the native module is ready.

Local testing: run npx expo run:ios or npx expo run:android after installing the library; Expo Go will not include the native code.

Usage

import { extractAudio } from 'expo-video-audio-extractor';
import * as FileSystem from 'expo-file-system';

const videoUri  = FileSystem.cacheDirectory + 'screen-recording.mov';
const outputUri = FileSystem.documentDirectory + 'speech.m4a';

await extractAudio({
  // Required
  video:  videoUri,
  output: outputUri,

  // Optional controls ↓
  format: 'm4a',      // 'm4a' (default) or 'wav'
  start:  2,          // begin 2 s into the video
  duration: 10,       // export 10 s of audio
  volume: 0.9,        // 90 % volume (linear gain)
  channels: 1,        // force mono (wav only)
  sampleRate: 16000,  // override sample-rate (wav only)
});

console.log('Audio saved at', outputUri);

API

| Option | Type | Default | Description | | ------------ | ----------------------- | -------- | ---------------------------------------------------------------------- | | video | string | — | Absolute/local URI to the input video | | output | string | — | Absolute path for the output audio (overwritten if already exists) | | format | 'm4a' \| 'wav' | m4a | Output container/codec | | start | number (seconds) | 0 | Offset into the video to begin extraction | | duration | number (seconds) | to end | Length of audio to export. Omit to export through the end of the video | | volume | number (0‒1) | 1 | Linear gain applied to the exported track | | channels | 1 \| 2 (WAV only) | input | Force mono or stereo output when exporting WAV | | sampleRate | number (Hz, WAV only) | input | Override sample-rate when exporting WAV |

Returns: Promise<string> — absolute file URI of the saved audio.

⚠️ m4a exports are passthrough — the original audio codec (usually AAC) is copied without re-encoding. If you need uniform sample rates or channel layouts, use wav.

Troubleshooting

| Problem | Fix | | ------------------------------ | --------------------------------------------------------------------------------------------------- | | Native module not linked | Rebuild the dev client (eas build --profile development) or run npx expo run-android / run-ios. | | Unsupported format error | Only 'm4a' & 'wav' are currently implemented. | | Audio length mismatch | Check start & duration values; ensure they reside within the video length. | | iOS < 12 crash | The podspec targets iOS 12+. Older OS versions are not supported. |

Contributing

PRs are welcome! See CONTRIBUTING.md for details.

License

MIT © 2025 Elliot Fleming

See LICENSE for details.