
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Automatic DJ-style audio mixer that sequentially blends MP3 files with BPM detection, pitch adjustment, and beat synchronization
Automatic DJ-style audio mixer that sequentially blends MP3 files with BPM detection, pitch adjustment, and beat synchronization.
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
# Windows (with Chocolatey)
choco install ffmpeg
# Windows (with winget)
winget install FFmpeg
npm install -g automixer
npm install automixer
# Basic usage - mix tracks in order
automixer mix track1.mp3 track2.mp3 track3.mp3 -o my_mix.mp3
# Specify crossfade duration (default: 8 seconds)
automixer mix track1.mp3 track2.mp3 -c 12 -o output.mp3
# Set a specific target BPM
automixer mix track1.mp3 track2.mp3 -b 128 -o output.mp3
# Allow pitch to change with tempo (faster processing)
automixer mix track1.mp3 track2.mp3 --no-preserve-pitch -o output.mp3
# Analyze a single track
automixer analyze track.mp3
# Analyze multiple tracks
automixer analyze track1.mp3 track2.mp3
# Output as JSON
automixer analyze track.mp3 --json
automixer check
| Option | Description | Default |
|---|---|---|
-o, --output <file> | Output file path | mix_output.mp3 |
-c, --crossfade <seconds> | Crossfade duration | 8 |
-b, --bpm <number> | Target BPM | Auto-detect |
--max-bpm-change <percent> | Maximum BPM change allowed | 8 |
--no-preserve-pitch | Allow pitch to change with tempo | Pitch preserved |
-q, --quiet | Suppress progress output | Show progress |
import AutoMixer from 'automixer';
const mixer = new AutoMixer({
crossfadeDuration: 8, // seconds
preservePitch: true,
maxBPMChange: 8 // percent
});
// Mix multiple tracks
await mixer.mix(
['track1.mp3', 'track2.mp3', 'track3.mp3'],
'output.mp3'
);
import { AutoMixer } from 'automixer';
const mixer = new AutoMixer({
crossfadeDuration: 10,
targetBPM: 128,
preservePitch: true
});
// Listen to events
mixer.on('analysis:track:start', ({ index, filepath }) => {
console.log(`Analyzing track ${index + 1}: ${filepath}`);
});
mixer.on('analysis:track:complete', ({ index, trackInfo }) => {
console.log(`Track ${index + 1}: ${trackInfo.bpm} BPM`);
});
mixer.on('mix:bpm', ({ targetBPM }) => {
console.log(`Target BPM: ${targetBPM}`);
});
mixer.on('mix:render:progress', ({ current, total, message }) => {
console.log(`Progress: ${current}/${total}`);
});
mixer.on('mix:complete', ({ outputPath }) => {
console.log(`Mix saved to: ${outputPath}`);
});
// Run the mix
await mixer.mix(['track1.mp3', 'track2.mp3'], 'output.mp3');
import { AutoMixer } from 'automixer';
const mixer = new AutoMixer();
// Add tracks
mixer.addTracks(['track1.mp3', 'track2.mp3', 'track3.mp3']);
// Analyze tracks
const analyzedTracks = await mixer.analyzeTracks();
// Log track information
for (const track of analyzedTracks) {
console.log(`${track.filename}: ${track.bpm} BPM, ${track.duration}s`);
}
// Get optimal BPM
const targetBPM = mixer.calculateOptimalBPM();
console.log(`Optimal BPM: ${targetBPM}`);
// Create the mix
await mixer.createMix('output.mp3');
import { BPMDetector, AudioAnalyzer, PitchShifter } from 'automixer';
// Detect BPM
const detector = new BPMDetector();
const { bpm, beats, confidence } = await detector.detect('track.mp3');
console.log(`BPM: ${bpm} (confidence: ${confidence})`);
// Get audio metadata
const analyzer = new AudioAnalyzer();
const metadata = await analyzer.getMetadata('track.mp3');
console.log(`Duration: ${metadata.duration}s`);
// Adjust tempo
const shifter = new PitchShifter();
const adjustedPath = await shifter.adjustTempo('track.mp3', 1.1, true);
console.log(`Tempo-adjusted file: ${adjustedPath}`);
Main class that orchestrates the mixing process.
| Option | Type | Default | Description |
|---|---|---|---|
crossfadeDuration | number | 8 | Crossfade duration in seconds |
targetBPM | number | null | Target BPM (auto-detect if null) |
preservePitch | boolean | true | Preserve pitch when changing tempo |
maxBPMChange | number | 8 | Maximum BPM change percentage |
outputFormat | string | 'mp3' | Output format |
outputBitrate | number | 320 | Output bitrate in kbps |
addTracks(filepaths) - Add tracks to the queueclearTracks() - Clear all tracksanalyzeTracks() - Analyze all tracks (returns track info)calculateOptimalBPM() - Calculate the optimal target BPMcreateMix(outputPath) - Create the final mixmix(inputFiles, outputPath) - Full process in one callanalysis:start - Analysis startedanalysis:track:start - Individual track analysis startedanalysis:track:complete - Individual track analysis completedanalysis:complete - All analysis completedmix:start - Mixing startedmix:bpm - Target BPM calculatedmix:prepare:start - Track preparation startedmix:prepare:complete - Track preparation completedmix:render:start - Rendering startedmix:render:progress - Rendering progress updatemix:complete - Mixing completedDetects BPM and beat positions in audio files.
const detector = new BPMDetector({ minBPM: 60, maxBPM: 200 });
const { bpm, beats, confidence } = await detector.detect('track.mp3');
Extracts metadata and analyzes audio characteristics.
const analyzer = new AudioAnalyzer();
const metadata = await analyzer.getMetadata('track.mp3');
// { duration, sampleRate, channels, bitrate, codec, format, tags }
Adjusts tempo and pitch of audio files.
const shifter = new PitchShifter();
// Adjust tempo (preserving pitch)
await shifter.adjustTempo('input.mp3', 1.1, true);
// Shift pitch (in semitones)
await shifter.shiftPitch('input.mp3', 2);
// Adjust both
await shifter.adjustTempoAndPitch('input.mp3', 1.1, 2);
Handles crossfading and track mixing.
const mixer = new TrackMixer({
crossfadeDuration: 8,
crossfadeCurve: 'log' // 'linear', 'log', 'sqrt', 'sine', 'exponential'
});
AutoMixer uses the music-tempo library combined with FFmpeg for BPM detection:
The mixing algorithm:
Tempo adjustment uses FFmpeg's audio filters:
maxBPMChange if tracks have very different tempos--no-preserve-pitch for faster processing when pitch shift is acceptableMake sure FFmpeg is installed and available in your PATH:
ffmpeg -version
Some tracks may have ambiguous tempos. You can:
-b optionmaxBPMChange to allow larger adjustmentsoutputBitrate: 320MIT License - see LICENSE file for details.
Project repository: https://github.com/manalejandro/automixer
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)FAQs
Automatic DJ-style audio mixer that sequentially blends MP3 files with BPM detection, pitch adjustment, and beat synchronization
We found that automixer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.