mixer utility mixes multiple sound files with independent control over start times, amplitudes, and channel routing. It supports time-varying gain curves and flexible output channel mapping.
Syntax
Global output options
| Option | Description |
|---|---|
-o <filename> | Output sound filename (default: test) |
-A | Create AIFF format output |
-W | Create WAV format output |
-h | No header (raw output) |
Output sample format
| Option | Description |
|---|---|
-c | 8-bit signed char |
-8 | 8-bit unsigned char |
-a | A-law encoded |
-u | μ-law encoded |
-s | 16-bit short int (default) |
-l | 32-bit long int |
-f | 32-bit float |
Per-file mixing options
| Option | Description |
|---|---|
-S <samples> | Start sample number for next input file |
-T <seconds> | Start time in seconds for next input file |
-F <factor> | Amplitude scale factor for next input |
-F <filename> | Time-varying gain curve file for next input |
Channel routing
| Option | Description |
|---|---|
-1 | Include channel 1 of next input |
-2 | Include channel 2 of next input |
-3 | Include channel 3 of next input |
-4 | Include channel 4 of next input |
^ <n> <m> | Route input channel n to output channel m |
Additional options
| Option | Description |
|---|---|
-R | Continuously rewrite header during writing |
-H <n> | Heartbeat: 1=spinner, 2=dots, 3=numeric |
-N | Ring bell when complete |
-v | Verbose mode for debugging |
-- <file> | Log output to file |
Examples
Basic mix of two files
Mix with start times
Mix with gain control
Mix with sample-accurate timing
Time-varying gain curve
curve.txt containing:
sample_number gain_factor
Channel routing examples
Mono to stereo (left channel):Complex multi-file mix
Gain scaling
Fixed gain
-F <factor> multiplies all samples by the factor:
0.5- Reduce by 6 dB1.0- No change (default)2.0- Increase by 6 dB0.0- Silence
Time-varying gain
-F <filename> uses a breakpoint file with format:
- Sample numbers are absolute positions in output file
- Gains are linearly interpolated between breakpoints
- Use
srate × timeto convert time to samples
Output duration
Output file length is determined by:- Latest ending input file
- Calculated as:
max(start_time + duration)across all inputs
Channel configuration
Output channels determined by:- Maximum channel referenced in routing
- If no routing specified, uses first input’s channel count
- Mono inputs → sum to mono output
- Stereo inputs → sum to stereo output
- Mixed channel counts → expand to maximum needed
Clipping and overflow
mixer tracks samples exceeding output range:
- Reduce input gains with
-F - Use float output format (
-f) for no clipping - Scale result with scale utility
Performance
Memory usage
Memory =output_samples × output_channels × 4 bytes
For 60 seconds stereo at 44.1kHz:
Processing time
Linear with:- Total output duration
- Number of input files
- Number of channels
Gain curve file tips
Create fade curves
Fade in (0 to 1 over 2 seconds):- File 1: Fade out starting at overlap point
- File 2: Fade in starting at overlap point
Generate curves with scripts
Python script for exponential fade:Common mixing scenarios
Music production
Podcast production
Sound design
Limitations
- Maximum 32 input files
- All inputs must have same sample rate
- Channel routing limited to channels 1-4
- Output clipping not prevented (use float or scale down)