Audio stream mixing tools


   1. Program list
      1.1. mixer
      1.2. mixmon
      1.3. mixwrite
      1.4. resample
      1.5. mixeridle
      1.6. ecat
      1.7. mixerscript
   2. Requirements
   3. Installation
   4. Copying
   5. Downloading

1. Program list

This package contains several audio stream tool programs for little-endian systems.

Note that none of these programs (except ecat) talk directly with a soundcard. They only handle raw audio streams.

1.1. mixer

A stream mixing server. It accepts mixwrite and mixmon -connections.
Provides a server for audio stream mixing.
Meant to be a replacement for esd, with much more features and much less cpu usage.

1.2. mixmon

Monitors the mixer over a tcp connection, reading whatever is being mixed to it.

1.3. mixwrite

Sends stream to the mixer over a tcp connection.

1.4. resample

Resamples audio stream from one format to another format, trying to not produce resampling artifacts.
resample v1.20.1 - Copyright (C) 1992,2006 Bisqwit (http://iki.fi/bisqwit/)
Portions copyright (C) 2001 ImageMagick Studio.
This program is under GPL. streamixer-1.20.1.tar.{gz,bz2}
are available at the homepage of the author.

Usage: /usr/local/bin/resample <inputspec> <outputspec> [<options> ...]

Reads stdin, writes stdout.

input- and outputspec:
   b=8-bit, m=mono, rxxx=xxx Hz, examples:
       ""      = 16-bit 44100 Hz stereo
       m       = 16-bit 44100 Hz mono
       b       = 8-bit 44100 Hz stereo
       mb      = 8-bit 44100 Hz mono
       mr22050 = 16-bit 22050 Hz mono
       br22050 = 8-bit 22050 Hz stereo
   etc. '-' must not be used.

Options:
  --help, -h              Help
  --version, -V           Version information
  --blur, -b <amount>     Blur: 0=normal, >0=blur (cpu intensive)
  --lflip, -L             Flip left channel
  --rflip, -R             Flip right channel
  --ldouble               Multiply left channel amplitude by 2
  --rdouble               Multiply right channel amplitude by 2
  --sharpen, -s <amount>  Equivalent to giving negative number to --blur
  --filter, -f <filter>   Select filter (interpolation scheme)

Available filters:
  none, linear, triangle, hermite, hanning, hamming,
  blackman, gaussian, quadratic, cubic, catrom, mitchell,
  lanczos, bessel, sinc
Recommended filters: linear, lanczos, none

1.5. mixeridle

Generates idle stream for the mixer, if there are readers for the mixer but no writers.
Actually has been hardcoded to play something nasty... you should probably customize it :)
Note that if mixeridle fails to produce anything, mixer will hang waiting.

1.6. ecat

Outputs its stdin to the audio device (/dev/dsp for example) with the specified bitness, stereo and sampling rate. Useful backend to the mixer (with mixmon).
This finally obsoletes my previous hack to do the same:
... | lame -rxdh -b 128 - - | mpg123 -q -

Here's a nice experiment to lower music pitch:

$ spcplay -r60000 -uao- ff5-world2.spc |ecat 
File: ff5-world2.spc
Song: Unknown Lands                        Game: Final Fantasy V                 
Comments: http://members.xoom.com/oksam_ff Author: Nobuo Uematsu, Squaresoft       
Dumper: AtLaS              Playtime: 0   Fadetime: 0   Emulator: Unknown (102)
Rate 70     Volume 100  12345678
And this plays two songs at the same time:
$ mixer &
$ mixmon|ecat &
$ mpg123 -s 01-Trust.mp3 |mixwrite &
$ mpg123 -s 14-DesperateFeelings.mp3 |mixwrite &
(total CPU load being around 25% with my 233 MHz laptop)

Hint: Sound card usually can't play arbitrary sampling rates. Use resample together with ecat to help.

$ mpg123 -r34500 -qvvs /mp3/OwaranaiNatsu.mp3 |ecat
Using memory mapped IO for this stream.
No supported rate found!

$ mpg123 -qvvs /mp3/OwaranaiNatsu.mp3 |resample r44100 r34500 -f lanczos|ecat
Using memory mapped IO for this stream.
Audio: 1:1 conversion, rate: 44100, encoding: signed 16 bit, channels: 2
128 kb/s - frame#  4215 [ 6300], Time: 01:50.10 [02:44.57], 
This example upsampled 44.1 kHz stream a happy 28% and played it with 44.1 kHz sampling rate, still not damaging the sound hearably. Try "none" as the filter (that's what most programs do) and you really do hear the difference. Try "linear" as the filter (that's what most programs do when they are "interpolating") and it's still not as good as it is when more modern filters are being used.

1.7. mixerscript

Mixes 16-bit stereo streams together in a predefined exact way.
Useful if you want to mix some wavs together.
A time offset may be defined.
mixerscript v1.20.1 - Copyright (C) 1992,2006 Bisqwit (http://iki.fi/bisqwit/)
This program is under GPL. streamixer-1.20.1.tar.{gz,bz2}
are available at the homepage of the author.

Usage: /usr/local/bin/mixerscript {<option> | <command>}

Writes stdout.

Note: All streams must be 16-bit stereo.
      Pipe the stream with resample program if this isn't the case...
Specify streams as commands which output the data.

Example: mixerscript -t0   'sox tmp.wav -t raw -' \
                     -t0.2 'mpg123 -s test.mp3' > test.raw

Options:
    -V, --version            Version information
    -b, --blocksize <float>  Set maxblocksize (default: 0.2) - experts only
    -h, --help               Help
    -r, --rate <int>         Set global sampling rate in hertz (defalt: 44100)
    -t, --at <float>         Set time offset of the next element (default: 0)
    -v, --volume <float>     Set mixing volume of the next element (default: 1)

2. Requirements

GNU make is probably required.

3. Installation

$ make
$ su
# make install
If you do not want to install libargh (included in the archive), do not use "make install" and edit Makefile and enable the STATIC linking instead of DYNAMIC.

4. Copying

These tools have been written by Joel Yliluoma, a.k.a. Bisqwit,
and are distributed under the terms of the General Public License (GPL).

Note: If you want to look at earlier versions, have a look at wavegenerator. The earlier versions were together in a same archive.

5. Downloading

Downloading help

  • Do not download everything - you only need one file (newest version for your platform)!
  • Do not use download accelerators or you will be banned from this server before your download is complete!

Date (Y-md-Hi) acc        Size Name                
2012-0304-0128 r--       46306 streamixer-1.20.2.tar.bz2
2012-0304-0128 r--       55695 streamixer-1.20.2.tar.gz
2006-0815-2236 r--       42553 streamixer-1.20.1.tar.bz2
2006-0815-2236 r--       47879 streamixer-1.20.1.tar.gz
2006-0815-2236 r--        4776 patch-streamixer-1.20.0-1.20.1.bz2
2006-0815-2236 r--        4744 patch-streamixer-1.20.0-1.20.1.gz
2006-0807-1851 r--       41984 streamixer-1.20.0.tar.bz2
2006-0807-1851 r--       47228 streamixer-1.20.0.tar.gz
2006-0807-1851 r--        8296 patch-streamixer-1.19.2-1.20.0.bz2
2006-0807-1851 r--        7954 patch-streamixer-1.19.2-1.20.0.gz
2005-0531-1543 r--       41807 streamixer-1.19.2.tar.bz2
2005-0531-1543 r--       45430 streamixer-1.19.2.tar.gz
2005-0531-1543 r--        7428 patch-streamixer-1.19.1-1.19.2.bz2
2005-0531-1543 r--        6730 patch-streamixer-1.19.1-1.19.2.gz
2005-0531-1543 r--       24084 patch-streamixer-1.18-1.19.2.bz2
2005-0531-1543 r--       24658 patch-streamixer-1.18-1.19.2.gz
2003-0916-1522 r--       41090 streamixer-1.19.1.tar.bz2
2003-0916-1522 r--       14113 patch-streamixer-1.19.0.1-1.19.1.bz2
2003-0916-1522 r--       15205 patch-streamixer-1.19.0-1.19.1.bz2
2003-0916-1522 r--       20554 patch-streamixer-1.18-1.19.1.bz2
2003-0306-1327 r--       40599 streamixer-1.19.0.1.tar.bz2
2003-0306-1327 r--       11855 patch-streamixer-1.19.0-1.19.0.1.bz2
2003-0306-1327 r--       18577 patch-streamixer-1.18-1.19.0.1.bz2
2003-0108-1525 r--       40560 streamixer-1.19.0.tar.bz2
2003-0108-1525 r--       17682 patch-streamixer-1.18.3-1.19.0.bz2
2003-0108-1525 r--       17448 patch-streamixer-1.18-1.19.0.bz2
2002-0815-1432 r--        7841 patch-streamixer-1.17.1-1.18.sh.bz2
2002-1214-1420 r--       38612 streamixer-1.18.3.tar.bz2
2002-1214-1420 r--        9649 patch-streamixer-1.18.2-1.18.3.bz2
2002-1106-2046 r--       39687 streamixer-1.18.2.tar.bz2
2002-1106-2046 r--        2831 patch-streamixer-1.18.1-1.18.2.bz2
2002-0826-2309 r--        1940 patch-streamixer-1.18-1.18.1.sh.bz2
2002-0826-2309 r--       39589 streamixer-1.18.1.tar.bz2
2002-0826-2309 r--        1477 patch-streamixer-1.18-1.18.1.bz2
2002-0815-1432 r--       39560 streamixer-1.18.tar.bz2
2002-0815-1432 r--        7745 patch-streamixer-1.17.1-1.18.bz2
2002-0815-1432 r--       20286 patch-streamixer-1.17-1.18.bz2
2002-0813-1059 r--       37165 streamixer-1.17.1.tar.bz2
2002-0813-1059 r--        7484 patch-streamixer-1.17-1.17.1.bz2
2002-0523-1138 r--       35655 streamixer-1.17.tar.bz2
2002-0523-1138 r--       11165 patch-streamixer-1.16.2-1.17.bz2
2002-0523-1138 r--       11281 patch-streamixer-1.16-1.17.bz2
2002-0501-2103 r--       30446 streamixer-1.16.2.tar.bz2
2002-0501-2103 r--         625 patch-streamixer-1.16.1-1.16.2.bz2
2002-0423-2352 r--       30461 streamixer-1.16.1.tar.bz2
2002-0423-2352 r--        1470 patch-streamixer-1.16-1.16.1.bz2
2002-0422-0002 r--       30186 streamixer-1.16.tar.bz2
Back to the source directory index at Bisqwit's homepage