Socket
Book a DemoInstallSign in
Socket

rns-audiomix

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rns-audiomix

Native module for mixing multiple audio recordings in **Expo React Native** (Android). It allows combining a base track with recordings, handling delays (`delayMs`), and optional monitoring during playback.

latest
npmnpm
Version
0.5.2
Version published
Weekly downloads
7
16.67%
Maintainers
1
Weekly downloads
 
Created
Source

audiomix

Native module for mixing multiple audio recordings in Expo React Native (Android).
It allows combining a base track with recordings, handling delays (delayMs), and optional monitoring during playback.

Installation

npm install audiomix

Link native module if needed (RN < 0.60):

react-native link audiomix

For RN 0.60+, autolinking handles it.

Usage

Import

import { audioMix } from 'audiomix';

Method: mixRecordings

audioMix(
  recordings: Array<{ id: string; uri: string; delayMs?: number }>,
  selectedIds: string[],
  baseTrack: string | null,
  monitorPlayback: boolean,
  syncValue: number,
)
  • recordings: List of recording objects. Each must include id and uri. Optional delayMs in ms.
  • selectedIds: Array of IDs from recordings to include in mixing.
  • baseTrack: Path/URI of base audio track (can be null).
  • monitorPlayback: If true, mixes with base track for monitoring.
  • syncValue: Sync adjustment in ms.
  • Returns: Promise resolving with the path of the mixed output .wav file (stored in app cache).

Example

const recordings = [
  { id: '1', uri: '/storage/emulated/0/Music/rec1.wav', delayMs: 120 },
  { id: '2', uri: '/storage/emulated/0/Music/rec2.wav', delayMs: 0 },
];

const selectedIds = ['1'];

const baseTrack = '/storage/emulated/0/Music/base.wav';

audioMix(
  recordings,
  selectedIds,
  baseTrack,
  true,    // monitorPlayback
  0        // syncValue
).then(outputPath => {
  console.log('Mixed audio file:', outputPath);
}).catch(err => {
  console.error('Mixing error:', err);
});

Notes

  • Output file is generated in the app cache directory with name pattern: mixed_output_<timestamp>.wav

  • On error, promise rejects with:

    • MIX_PREP_ERROR: Input or preparation error.
    • MIX_ERROR: Mixing process failed.

License

MIT

Keywords

react-native

FAQs

Package last updated on 17 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts