Audio stream mixing tools

0. Contents

This is the documentation of streamixer-1.19.0.
   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.19.0 - Copyright (C) 1992,2003 Bisqwit (http://bisqwit.iki.fi/)
Portions copyright (C) 2001 ImageMagick Studio.
This program is under GPL. streamixer-1.19.0.tar.{gz,bz2}
are available at the homepage of the author.

Usage: 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. '-' is optional.

Options:
    -V, --version          Version information
    -b, --blur <num>       blur: 0=normal, >0=blur
                           (note: blurring requires cpu power.)
    -f, --filter <filter>  Select filter of the following:
                              none, linear (default), triangle,
                              hermite, hanning, hamming, blackman,
                              gaussian, quadratic, cubic, catrom,
                              mitchell, lanczos, bessel, sinc
    -h, --help             Help
    -s, --sharpen <num>    sharpen: 0=normal, >0=sharper
                           (note: blurring and sharpening are exclusive.)

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.19.0 - Copyright (C) 1992,2003 Bisqwit (http://bisqwit.iki.fi/)
This program is under GPL. streamixer-1.19.0.tar.{gz,bz2}
are available at the homepage of the author.

Usage: 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

The official home page of streamixer is at http://oktober.stc.cx/source/streamixer.html.
Check there for new versions.

Generated from progdesc.php (last updated: Wed, 8 Jan 2003 17:25:03 +0200)
with docmaker.php (last updated: Tue, 13 Aug 2002 14:17:29 +0300)
at Wed, 8 Jan 2003 17:25:07 +0200