home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit v2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Unix / HOWTOs / SOUND-PL < prev    next >
Text File  |  1999-11-04  |  31KB  |  925 lines

  1.   The Linux Sound Playing HOWTO
  2.   Yoo C. Chung, wacko@laplace.snu.ac.kr
  3.   v1.6, 11 August 1998
  4.  
  5.   This document lists applications for Linux that play various sound
  6.   formats.
  7.  
  8.  
  9.   1.  Introduction
  10.  
  11.   This is the Sound Playing HOWTO.  It lists the many sound formats and
  12.   the applications that can be used to play them.  It also lists some
  13.   hacks and advice on using these applications.  There are also some
  14.   other interesting applications related to sound not directly related
  15.   to playback.  However, this document does not describe how one can
  16.   setup a Linux system for sound support.  Refer to the Linux Sound
  17.   HOWTO by Jeff Tranter for instructions on setting up a Linux system
  18.   for sound support and the supported sound hardware.
  19.  
  20.   This deals with normal user sound applications.  That is, it is only
  21.   concerned about what the average user needs to know on the application
  22.   side of sound, not exotic stuff like speech synthesis, or hardware
  23.   stuff which is dealt in the Sound HOWTO.
  24.  
  25.  
  26.  
  27.   1.1.  Copyright of this document
  28.  
  29.   This document can be freely distributed and modified (I would
  30.   appreciate it if I were notified of any modifications), as long as
  31.   this copyright notice is preserved.  However, it cannot be placed
  32.   under any further restrictions, and a modified document must have the
  33.   same copyright as this one.  Also, credit must be given where due.
  34.  
  35.  
  36.  
  37.   1.2.  Copyright of the listed applications
  38.  
  39.   If there is no mention of any copyright, then the application is under
  40.   the GNU General Public License.
  41.  
  42.  
  43.  
  44.   1.3.  Where to get this document
  45.  
  46.   The most recent official version of this document can be obtained from
  47.   the Linux Documentation Project <http://sunsite.unc.edu/LDP/>.  The
  48.   most recent unofficial version of this document can be obtained from
  49.   <http://laplace.snu.ac.kr/~wacko/howto/>.
  50.  
  51.   A Korean version of this document (very outdated) is available at
  52.   <http://laplace.snu.ac.kr/~wacko/howto/Sound-Playing-HOWTO.ks>.
  53.  
  54.   A Japanese version of this document is available at
  55.   <http://jf.gee.kyoto-u.ac.jp/JF/JF-ftp/euc/Sound-Playing-HOWTO.euc>.
  56.  
  57.  
  58.  
  59.   1.4.  Feedback
  60.  
  61.   I am not omniscient, and I don't use all the applications in here (a
  62.   few I can't even try), so there are bound to be mistakes.  Also,
  63.   programs usually continuously evolve, so documentation tends to get
  64.   out of date.  Therefore, if you find anything wrong, please send me
  65.   any corrections.  Suggestions or additions to this document are
  66.   welcome, too.
  67.   1.5.  Acknowledgments
  68.  
  69.   All the authors of the applications in this HOWTO.  Also, Hannu
  70.   Savolainen for the great sound driver and Linus Torvalds for the great
  71.   underlying OS.
  72.  
  73.   I'd also like to thank Raymond Nijssen (raymond@es.ele.tue.nl), Jeroen
  74.   Rutten (jeroen@es.ele.tue.nl), Antonio Perez (aperez@arrakis.es), Ian
  75.   Jackson (ijackson@gnu.org), and Peter Amstutz
  76.   (amstpi@freenet.tlh.fl.us) for their information and help.
  77.  
  78.  
  79.  
  80.   2.  Playing Various Sound Formats
  81.  
  82.   There are many kinds of sound formats (WAV, MIDI, MPEG etc.).  Below,
  83.   we list the various formats and the applications that can be used to
  84.   play them.
  85.  
  86.  
  87.  
  88.   2.1.  MIDI
  89.  
  90.   MIDI stands for Musical Instrument Device Interface.  MIDI files
  91.   usually have the extension .mid.  They contain sequencing information,
  92.   that is, information on when to play what instrument in what way, etc.
  93.   Depending on your hardware (and maybe the software you use to play
  94.   them), the sound might be awesome, or it might be downright crappy.
  95.  
  96.  
  97.  
  98.   2.1.1.  adagio
  99.  
  100.   This package includes mp (a command-line MIDI file player) and xmp (an
  101.   XView based MIDI file player, not to be confused with the module
  102.   player also called xmp).  You will need the SlingShot extensions to
  103.   use xmp.  It also contains other programs for playing Adagio scores.
  104.  
  105.  
  106.   If you have a GUS, mp can also play MOD files (see section ``Modules''
  107.   for more information on modules).
  108.  
  109.   One little annoying bug (as of version 0.5 on some hardware) is that
  110.   the sound breaks at the end.  Namely, instead of ending the sound the
  111.   way the MIDI file specifies, it ends by playing the note right before
  112.   the last one in a long interval.  It hasn't stopped me from using mp,
  113.   but it might prevent someone from using it for `real' work.  It also
  114.   starts up relatively slowly.
  115.  
  116.   The package does not mention any copyright (at least none that I can
  117.   find), so I assume it can be freely redistributed and modified.  (By a
  118.   strict interpretation of copyright law, nothing gives one the right to
  119.   do these things, but I somehow doubt that this was the intention of
  120.   the author.)
  121.  
  122.   It is a port of the CMU MIDI Toolkit to Linux (though there was enough
  123.   added to make this questionable) by Greg Lee
  124.   (lee@uhunix.uhcc.hawaii.edu).
  125.  
  126.   It can be obtained from
  127.   <ftp://tsx-11.mit.edu/pub/linux/packages/sound/adagio05.tar.gz>.  The
  128.   binaries included here are in a.out format (linked with ancient
  129.   libraries), and the xmp binary segfaults in a X11R6 environment
  130.   (XFree86 3.1.1, libc 4.7.2).  The mp binary works fine in an a.out
  131.   environment.
  132.  
  133.   You will need a bit of hackery to compile it.  Actually, it's not much
  134.   of a hackery.  All you have to do is to include the -lfl switch at the
  135.   end of SHROBJ and XMPOBJ in the Makefile.  This is to link in the flex
  136.   library, which is not linked in by default.  Then follow the
  137.   installation instructions.  And don't forget to have XView and the
  138.   SlingShot extensions installed if you want to compile xmp.
  139.  
  140.  
  141.  
  142.   2.1.2.  TiMidity
  143.  
  144.   Some people recommend this experimental program because of good sound
  145.   quality (which is very true, it's much better than mp on a Sound
  146.   Blaster 16, though it probably won't be much different on soundcards
  147.   with wavetable synthesis like the GUS).  However, it suffers from high
  148.   CPU loads.  It plays MIDI by first converting MIDI to WAV and then
  149.   plays the WAV (you can also convert a MIDI file to a WAV file without
  150.   playing if you want).  This is the reason for its CPU intensive
  151.   nature.
  152.  
  153.   It also has an optional ncurses, SLang, Tcl/Tk or Motif interface.
  154.  
  155.   You need Gravis Ultrasound patch files to use this.  Look into the FAQ
  156.   included with TiMidity for more information.
  157.  
  158.   The author is Tuukka Toivonen (tt@cgs.fi).
  159.  
  160.   The latest version of TiMidity can be found at the TiMidity home page
  161.   <http://www.cgs.fi/~tt/timidity/>.  This page also contains a link to
  162.   a small library of GUS patches.
  163.  
  164.  
  165.  
  166.   2.1.3.  playmidi
  167.  
  168.   This is a MIDI player that plays to FM, GUS, and external MIDI.  It is
  169.   supposed to have a faster startup time compared to other MIDI players.
  170.   It is also able to play Creative Music Files, Microsoft RIFF files,
  171.   and large MIDI archives from games such as Ultima 7.
  172.  
  173.   It has an X interface and a SVGA interface.  It also has an option for
  174.   real time playback with tracking all the notes on each channel and the
  175.   current playback clock (included automatically with xplaymidi and
  176.   splaymidi).
  177.  
  178.   You should do something like
  179.  
  180.  
  181.  
  182.        $ splaymidi foo.mid; stty sane
  183.  
  184.  
  185.  
  186.  
  187.  
  188.   if you are going to use the SVGA interface, since it doesn't reset the
  189.   terminal tty mode properly.  The SVGA interface may be removed in the
  190.   near future.
  191.  
  192.   It was written by Nathan Laredo (laredo@gnu.org or
  193.   laredo@ix.netcom.com).
  194.  
  195.   It can be obtained from
  196.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/playmidi-2.3.tar.gz>.
  197.  
  198.  
  199.   2.2.  Modules
  200.  
  201.   Modules (in computer music) are digital music files, made up of a set
  202.   of samples and sequencing information, telling the player when to play
  203.   which sample (instrument) on which track at what pitch, optionally
  204.   performing an effect, like vibrato for example.
  205.  
  206.   An advantage it has over MIDI is that it can include almost any kind
  207.   of sound (including human voices).  Another is that it sounds just
  208.   about the same on any platform, because the samples are in the module.
  209.   A disadvantage it has is that it has a much larger file size compared
  210.   to MIDI.  Another one is that it has no real standard format (the only
  211.   `real' one is the ProTracker, which many modules aren't quite
  212.   compatible with).  It originated on the Amiga.
  213.  
  214.   The most common format has the extension .mod.  There are many other
  215.   extensions depending on what format they are in.
  216.  
  217.  
  218.  
  219.   2.2.1.  tracker
  220.  
  221.   This very portable program (it has been ported to many platforms)
  222.   plays Soundtracker and Protracker music modules.  It uses 16 bit
  223.   stereo output, and I consider the quality to be very good.  If you
  224.   need a simple way to reduce CPU load use the -mono option.
  225.  
  226.   This is a giftware program (quoting the author).  It is by Marc Espie
  227.   (Marc.Espie@ens.fr).
  228.  
  229.   A version of this with the Makefile already tweaked for Linux can be
  230.   obtained from
  231.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/tracker-4.3-linux.tar.gz>.
  232.  
  233.  
  234.  
  235.   2.2.2.  gmod
  236.  
  237.   This is a music module player for the Gravis Ultrasound card.  4/6/8
  238.   channel MOD, 8 channel 669, MultiTracker (MTM), UltraTracker (ULT),
  239.   FastTracker (XM), and ScreamTracker III (S3M) are the supported
  240.   formats.
  241.  
  242.   It requires a version 3.0 or later sound driver.  And a GUS, of
  243.   course.  You may need to modify the kernel to make volume control work
  244.   the way you want.
  245.  
  246.   This has an X interface.  It uses the QT toolkit (needs version 0.99
  247.   or greater).  Check the QT toolkit homepage <http://www.troll.no/> for
  248.   information on QT.
  249.  
  250.   This can be freely distributed.  It was originally written by Hannu
  251.   Savolainen, and now maintained by Andrew J. Robinson
  252.   (robinson@cnj.digex.net).
  253.  
  254.   It can be obtained from
  255.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/gmod-3.1.tar.gz>.
  256.  
  257.  
  258.  
  259.   2.2.3.  MikMod
  260.  
  261.   This portable module player plays XM, ULT, STM, S3M, MTM, MOD and UNI
  262.   formats.  (The UNI format is an internal format used by MikMod.)  It
  263.   has support for zipped module files.  It uses 16 bit stereo for the
  264.   sound output.  Use the -m option (for mono output) if you need a
  265.   simple way to lower the CPU load.
  266.  
  267.   The Unix version can either use ncurses or Tcl/Tk for its interface.
  268.   It can also be used as a library, not just an independent program.
  269.  
  270.   It was originally written by Jean-Paul Mikkers (mikmak@via.nl).  It is
  271.   now maintained by Jake Stine (dracoirs@epix.net).  This is shareware
  272.   that has to be registered if you want to use it commercially.  You
  273.   also need permission to redistribute it commercially (non-commercial
  274.   redistribution does not need such permission).
  275.  
  276.   This can be found at the MikMod home page
  277.   <http://www.freenet.tlh.fl.us/~amstpi/mikmod.html>.
  278.  
  279.  
  280.  
  281.   2.2.4.  xmp
  282.  
  283.   This is a module player (not to be confused with Adagio's xmp) which
  284.   can play MOD, S3M, MTM, PTM, PTR, STM, 669, and XM modules (other
  285.   formats are also supported, but still experimental or incomplete).  If
  286.   you have soundcards with wavetable synthesis (GUS or SoundBlaster
  287.   32AWE), then you can use this feature of the soundcard to lower the
  288.   load on the CPU.  It also supports compressed modules.
  289.  
  290.   An X frontend to xmp is also available.
  291.  
  292.   This was written by Claudio Matsuoka (claudio@pos.inf.ufpr.br) and
  293.   Hipolito Carraro Jr.
  294.  
  295.   This can found at the xmp home page <http://xmp.home.ml.org/>.
  296.  
  297.  
  298.  
  299.   2.2.5.  s3mod
  300.  
  301.   This plays 4/6/8 track MOD modules and Scream Tracker 3 modules.  It
  302.   uses 8 bit mono output with a sampling rate of 22000 Hz by default.
  303.   You can use the option -s to enable stereo, -b to enable 16 bit
  304.   output, and -f to set the sampling frequency.  However, the sound
  305.   output is worse than tracker (some noise), so I recommend using
  306.   tracker instead of s3mod for playing ordinary MOD files (unless you
  307.   have an underpowered machine).  It has a much smaller CPU load
  308.   compared to tracker.
  309.  
  310.   It is copyrighted by Daniel Marks and David Jeske (jeske@uiuc.edu),
  311.   but you can do anything you want with it (except that you can't claim
  312.   you wrote it).
  313.  
  314.   It can be obtained from
  315.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/s3mod-
  316.   v1.09.tar.gz>.
  317.  
  318.  
  319.  
  320.   2.2.6.  mod
  321.  
  322.   This beta program plays MODs (15/31-instrument, up to 32 voices),
  323.   MTMs, ULTs and S3Ms on the Gravis Ultrasound card.  It can also use
  324.   packed modules if you have gzip, lharc, unzip, and unarj installed.
  325.   It cannot play Powerpacked modules or modules packed with some Amiga
  326.   composers ("PACK" signature).
  327.  
  328.   This requires at least version 3.0 of the sound driver.  It won't work
  329.   with the 2.90-2 or earlier version of the sound driver.  The text
  330.   interface requires ncurses.  There is also an X interface included,
  331.   which uses Tcl/Tk.
  332.  
  333.   It was written by Mikael Nordqvist (mech@df.lth.se or
  334.   d91mn@efd.lth.se).
  335.  
  336.   It can be obtained from
  337.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/mod-v0.81.tgz>.
  338.  
  339.  
  340.  
  341.   2.2.7.  nspmod
  342.  
  343.   This is an alpha module player which can play MTM, S3M, and MOD
  344.   modules.  It is intended to be a module player for soundcards without
  345.   a DSP (not to be confused with what Creative Labs calls a DSP).  It
  346.   has a CPU load somewhat similar compared to tracker.
  347.  
  348.  
  349.   It has a feature which lets modules loop if they want to.  The number
  350.   of loops can be limited by the -l option.  It uses only 8 bit sound
  351.   output (as of version 0.1).
  352.  
  353.   This was written by Toru Egashira (toru@jms.jeton.or.jp).
  354.  
  355.   It can be obtained from
  356.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/nspmod-0.1.tar.gz>.
  357.  
  358.  
  359.  
  360.   2.2.8.  yampmod
  361.  
  362.   This alpha program was designed to play 4-channel modules using the
  363.   minimum of CPU resources.  It was not designed to produce high quality
  364.   sound.  So the only sound output it produces is 22 kHz mono output.
  365.   Also, the output isn't as clean as it should be, reflecting its alpha
  366.   status.
  367.  
  368.   It was written by David Groves (djg@djghome.demon.co.uk).
  369.  
  370.   It can be obtained from
  371.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/yampmod-0.1.tar.gz>.
  372.  
  373.  
  374.  
  375.   2.3.  MPEG audio streams
  376.  
  377.   MPEG is a standard specifying the coding of video and the associated
  378.   audio for digital storage.  MPEG is usually associated with video, but
  379.   the audio part of the standard can be used separately.  The audio part
  380.   of the MPEG standard defines three layers, layer I, II, and III.
  381.   Players that can decode higher layers can also decode lower layers
  382.   (e.g. layer III players can play layer II files).  Layer I MPEG audio
  383.   files usually have the extension .mpg (so if there is a file with this
  384.   extension that can't be played by a MPEG video player, it's probably
  385.   an audio stream), layer II usually have the extension .mp2, and layer
  386.   III usually have the extension .mp3.  The audio compression is pretty
  387.   good.  A two megabyte layer II MPEG audio file will probably take up
  388.   25 megabytes for a raw PCM sample file with the same quality.
  389.  
  390.  
  391.  
  392.   2.3.1.  mpg123
  393.  
  394.   This beta program is an efficient MPEG audio stream player, which has
  395.   support for layers I, II, and III.  It is based on code from many
  396.   sources.  It is able to play in real time streams that are read by
  397.   HTTP (i.e. one can play an MPEG audio stream directly over the World
  398.   Wide Web).
  399.  
  400.   The main author is Michael Hipp (Michael.Hipp@student.uni-
  401.   tuebingen.de).  It may be used and distributed in unmodified form
  402.   freely for non-commercial purposes.  Inclusion in a collection of free
  403.   software (such as CD-ROM images of FTP servers) is explicitly allowed.
  404.  
  405.   The latest version can be obtained from the mpg123 homepage
  406.   <http://mpg.123.org/>.
  407.  
  408.  
  409.  
  410.   2.3.2.  maplay 1.2
  411.  
  412.   This MPEG audio stream player only has support for layer I and layer
  413.   II streams, and lacks support for layer III streams.  It supports 16
  414.   bit sound cards on Linux.
  415.  
  416.   It is pretty CPU intensive, taking up to about 55% CPU time on a 60MHz
  417.   Pentium.  The output is intolerable on a 66MHz 486 because the CPU
  418.   just can't catch up with the sound.  If this happens to you, try
  419.   playing only one side of the audio stream (with the -l or -r option),
  420.   instead of the default stereo.
  421.  
  422.   A slight change in one of the files may be necessary in order to
  423.   compile it.  Namely, you may need to add the following line to the
  424.   beginning of the file configuration.sh.
  425.  
  426.  
  427.  
  428.        #! /bin/sh
  429.  
  430.  
  431.  
  432.  
  433.  
  434.   The author is Tobias Bading (bading@cs.tu-berlin.de).  maplay 1.2 can
  435.   be obtained from  <ftp://ftp.cs.tu-
  436.   berlin.de/pub/misc/maplay1.2/maplay1_2.tar>.
  437.  
  438.  
  439.  
  440.   2.3.3.  maplay 1.3b
  441.  
  442.   This is an unofficial modification (i.e. not by the original author)
  443.   of maplay 1.2, so that it can run with a much lower load on the CPU.
  444.   It accomplishes this mainly by making u-law output actually work on
  445.   other platforms besides the SPARC.  Note that it uses u-law output by
  446.   default, so the sound quality is lower.
  447.  
  448.   The modifications were made by Orlando Andico
  449.   (orly@gibson.eee.upd.edu.ph).
  450.  
  451.   This can be obtained from
  452.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/maplay-1.3b-
  453.   Linux.tar.gz>.
  454.  
  455.  
  456.  
  457.   2.3.4.  maplay3
  458.  
  459.   This is another derivative of maplay 1.2.  It adds support for MPEG
  460.   Layer 3 audio streams.  Currently it seems to have some bugs in its
  461.   playback (you may hear some screeching noises).  You may have to
  462.   twiddle with the options to solve this.
  463.   The modifications were made by Timo Jantunen (timo.jantunen@hut.fi or
  464.   jeti@cc.hut.fi).  It says that it can be used freely, but making money
  465.   off of it is not allowed.  However, I'm not entirely sure about the
  466.   validity of this copyright, since the original maplay is under the GNU
  467.   General Public License, which does not allow derivative works to have
  468.   a different copyright.
  469.  
  470.   This can be obtained from
  471.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/maplay3.tar.gz>.
  472.  
  473.  
  474.  
  475.   2.3.5.  splay
  476.  
  477.   This beta player is another derivative of maplay 1.2 (actually, it is
  478.   a derivative of maplay 1.2+, which is a MS Windows only derivative of
  479.   maplay 1.2).  It adds support for MPEG Layer 3 audio streams.  It is
  480.   also able to play WAV files.  It can also play audio streams received
  481.   over an HTTP connection.
  482.  
  483.   Another feature of splay is that it can be used as a library (under
  484.   the LGPL), so that it can be used in other programs.  It also tries to
  485.   improve performance by using threading (you need pthread to use this
  486.   feature) and a little inline assembly.
  487.  
  488.   splay uses a command line interface and an optional X interface (which
  489.   uses QT).
  490.  
  491.   If after compiling it doesn't work (e.g. it segmentation faults), try
  492.   compiling it again without threading.
  493.  
  494.   This is by Jung Woo-jae (jwj95@eve.kaist.ac.kr).
  495.  
  496.   It can be obtained from splay's home page
  497.   <http://adam.kaist.ac.kr/~jwj95/>.
  498.  
  499.  
  500.  
  501.   2.3.6.  Sajber Jukebox
  502.  
  503.   This program is a MPEG audio player with a graphical user interface.
  504.   It is based on splay, so it includes support for MPEG audio layers up
  505.   to III.  It is also able to play MPEG audio streams in real time with
  506.   the stream being fed by HTTP.  It is also easy to configure.
  507.  
  508.   It uses the QT toolkit (at least version 1.2 is required).  It also
  509.   uses the LinuxThreads library (the included binary only works with
  510.   version 0.5).
  511.  
  512.   The author is Joel Lindholm (wizball@kewl.campus.luth.se).
  513.  
  514.   The latest version can be obtained from
  515.   <ftp://kewl.campus.luth.se/pub/jukebox>.
  516.  
  517.  
  518.  
  519.   2.3.7.  amp
  520.  
  521.   This beta MPEG audio player only has support for MPEG Layer 3 audio
  522.   streams.  It is able to play directly to the soundcard, and it can
  523.   output to raw PCM or WAV files.  This also gives quite a load on the
  524.   CPU (about 60% on a 133MHz Pentium).
  525.  
  526.   This was written by Tomislav Uzelac (tuzelac@rasip.fer.hr).  It can be
  527.   freely used and distributed, as long as it is not sold commercially
  528.   without permission (including it in CD-ROMs that contain free software
  529.   is explicitly permitted, though).
  530.  
  531.   It can be obtained from
  532.   <ftp://ftp.rasip.fer.hr/pub/mpeg/amp-0.7.3.tgz>.
  533.  
  534.  
  535.  
  536.   2.3.8.  XAudio
  537.  
  538.   This alpha library was written to be a fast implementation of an MPEG
  539.   audio decoding library to be used by various GUI front-ends.  It
  540.   supports MPEG audio layers I, II, and III.  It is capable of random
  541.   access to bitstreams.  A command-line interface is included.  A Motif
  542.   (Lesstif) front-end is also included in the Linux version.
  543.  
  544.   This is by Gilles Boccon-Gibod, Alain Jobart and others.  The front-
  545.   ends to the libary can be freely downloaded.  The library itself must
  546.   be licensed to be used (a source and binary license is available).
  547.  
  548.   The front-ends to the library can be obtained from the XAudio home
  549.   page <http://www.xaudio.com/>.
  550.  
  551.  
  552.  
  553.   2.3.9.  Layer 3 Shareware Encoder/Decoder
  554.  
  555.   This is actually a converter that converts MPEG Layer 3 audio streams
  556.   to WAV, AIFF, SND, AIFC, or just raw PCM sample files.  The Linux
  557.   version does not directly output the sound to the soundcard.  One has
  558.   to first convert it to some other format.
  559.  
  560.   However, when you try to play a converted file using sox, you'll
  561.   probably just get noise because the word order in the PCM samples is
  562.   not right (at least on Intel platforms).  You need to give sox the
  563.   option -x to solve this problem.  But there are some players that
  564.   don't have to be told that the word order is wrong, so you might not
  565.   have to worry about this.
  566.  
  567.   If you have a really fast computer (probably at least a 100Mhz
  568.   Pentium), then you can try to play MPEG Layer 3 streams directly
  569.   without having to first convert the audio file to another format like
  570.   in the following example (this example assumes that you're using sox
  571.   and playing a 44.1 kHz stereo sample).
  572.  
  573.  
  574.  
  575.        $ l3dec foo.mp3 -sto | play -t raw -x -u -w -c 2 -r 44100 -
  576.  
  577.  
  578.  
  579.  
  580.  
  581.   The number after -r is the sample rate of the audio stream, and the
  582.   number after -c depends on whether it is mono or stereo (or even
  583.   quad).  If this looks too complicated, you can use something like a
  584.   shell script or an alias.
  585.  
  586.   This is shareware copyrighted by Fraunhofer-IIS.  A demo version for
  587.   Linux on x86 systems can be obtained from
  588.   <ftp://ftp.fhg.de/pub/layer3>.  The demo version only converts layer
  589.   III audio streams.
  590.  
  591.  
  592.  
  593.  
  594.  
  595.   2.3.10.  X11Amp
  596.  
  597.   This beta software is an MPEG audio stream player with a graphical
  598.   interface,  similar to the one used by the Windows program winamp.
  599.  
  600.   There is no copyright mentioned anywhere (I assume that it can be
  601.   freely used for personal use).  It is maintained by Mikael Alm
  602.   (psy@x11amp.bz.nu), Thomas Nilsson (fatal@x11amp.bz.nu), and Olle
  603.   Hallnas (crocodile@x11amp.bz.nu).
  604.  
  605.   It can be obtained from X11Amp's homepage <http://www.x11amp.bz.nu/>.
  606.   Only binaries for Intel Linux and FreeBSD are made available here.
  607.  
  608.  
  609.   2.4.  WAV
  610.  
  611.   Quote from the sox man page:
  612.  
  613.  
  614.        These appear to be very similar to IFF files, but not the
  615.        same.  They are the native sound file format of Windows 3.1.
  616.        Obviously, Windows 3.1 is of such incredible importance to
  617.        the computer industry that it just had to have its own sound
  618.        file format.
  619.  
  620.  
  621.   These usually have the extension .wav.
  622.  
  623.   Also see section ``sox'' and ``bplay'' for other WAV players besides
  624.   the ones listed here.
  625.  
  626.  
  627.  
  628.   2.4.1.  wavplay
  629.  
  630.   This program supports playing and recording with the WAV format.  It
  631.   uses locking so that only one sound may be played at a time.  Its
  632.   locking capabilities can also be used separately from its sound
  633.   playing capabilities.
  634.  
  635.   In addition to a command-line interface, it also has a Motif
  636.   interface, which can be used with Lesstif.
  637.  
  638.   It was originally written by Andre Fuechsel (af1@irz.inf.tu-
  639.   dresden.de), but was evolved to the point of being completely
  640.   rewritten by Warren W. Gay (bx249@freenet.toronto.on.ca or
  641.   wwg@ica.net).
  642.  
  643.   It can be obtained from
  644.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/wavplay-1.0.tar.gz>.
  645.  
  646.  
  647.  
  648.   2.5.  Other stuff
  649.  
  650.   This section lists stuff that play sound formats that don't deserve a
  651.   separate section (i.e. formats that have only one player available),
  652.   or players that play more than one format.
  653.  
  654.  
  655.  
  656.   2.5.1.  sox
  657.  
  658.   This program is actually a converter, that is, it converts one sound
  659.   format to another.  However, some versions of sox, when invoked as
  660.   play, plays the sound (the play application in the Sound HOWTO
  661.   probably refers to this).  It supports raw (no header) binary and
  662.   textual data, IRCAM Sound Files, Sound Blaster .voc, SPARC .au
  663.   (w/header), Mac HCOM, PC/DOS .sou, Sndtool, and Sounder, NeXT .snd,
  664.   Windows 3.1 RIFF/WAV, Turtle Beach .smp, CD-R, and Apple/SGI AIFF and
  665.   8SVX formats
  666.  
  667.  
  668.   Since somewhere in the 1.3.6x kernels, you might have to make a small
  669.   change in one file to make it play the sound directly.  Namely, you
  670.   may have to change line 179 in sbdsp.c from
  671.  
  672.  
  673.  
  674.        if (abuf_size < 4096 || abuf_size > 65536) {
  675.  
  676.  
  677.  
  678.  
  679.  
  680.   to
  681.  
  682.  
  683.  
  684.        if (abuf_size < 1 || abuf_size > 65536) {
  685.  
  686.  
  687.  
  688.  
  689.  
  690.   But then again, you may not have to do this.  But doing this won't
  691.   break anything.
  692.  
  693.  
  694.   It is written and copyrighted by many people, and can be used for any
  695.   purpose.
  696.  
  697.   It can be obtained from
  698.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/convert/Lsox-
  699.   linux.tar.gz>.
  700.  
  701.   A more recent version by Chris Bagwell (cbagwell@sprynet.com) (based
  702.   on the latest gamma version of the original sox, and includes the
  703.   above fix) can be obtained from
  704.   <http://home.sprynet.com/sprynet/cbagwell/projects.html>.  In
  705.   addition, this version supports MS ADPCM and IMA ADPCM WAV formats.
  706.  
  707.  
  708.  
  709.   2.5.2.  bplay
  710.  
  711.   This beta program plays raw audio, WAV, and VOC files.  It's also able
  712.   to record to these files.  It uses a variety of techniques to get the
  713.   highest speed possible so that it can run acceptably even on slow
  714.   machines.  One of these techniques require that the installed programs
  715.   be setuid root.  The paranoid hoping to use this may want to use the
  716.   Debian package by Ian Jackson (ijackson@gnu.org), which disables the
  717.   feature that needs the setuid bit.
  718.  
  719.   The author is David Monro (davidm@gh.cs.usyd.edu.au).
  720.  
  721.   It can be obtained from
  722.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/bplay-0.96.tar.gz>.
  723.  
  724.  
  725.  
  726.  
  727.   2.5.3.  SIDPLAY
  728.  
  729.   This program emulates the Sound Interface Device chip (MOS 6581,
  730.   commonly called SID) and the Micro Processor Unit (MOS 6510) of the
  731.   Commodore 64.  Therefore it is able to load and execute C64 machine
  732.   code programs which produce music or sound.  In general these are
  733.   independent fragments of code and data which have been ripped from
  734.   games and demonstration programs and have been transferred directly
  735.   from the C64.
  736.  
  737.   It uses a command line interface by default.  There are also Tk and QT
  738.   interfaces available separately from the main package.
  739.  
  740.   It is maintained by Michael Schwendt (sidplay@geocities.com).
  741.  
  742.   It can be obtained from SIDPLAY's home page
  743.   <http://www.geocities.com/SiliconValley/Lakes/5147/>.
  744.  
  745.  
  746.  
  747.   2.5.4.  RealAudio Player
  748.  
  749.   This lets you listen to sound, which is stored in a proprietary
  750.   format, in real time over the Internet without downloading the whole
  751.   sound file first.  It could be used stand alone, but it is really
  752.   intended to be used along with a web browser (the explicitly supported
  753.   ones are Mosaic and Netscape).  It cannot be used without X (you
  754.   wouldn't be able to get it working with Lynx in a text console).
  755.  
  756.   However, there exists a hack which allows one to run the RealAudio
  757.   player from the text console.  It requires the X virtual frame buffer
  758.   (Xvfb) server to work.  This hack can be obtained from
  759.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/traplayer-0.5.tar.gz>.
  760.  
  761.   This is by Progressive Networks, Inc.  This cannot be redistributed,
  762.   modified etc.  Look at the license for exact details on what you can
  763.   do.  It can be obtained by registering with no cost at the RealAudio
  764.   home page <http://www.realaudio.com/>.
  765.  
  766.  
  767.  
  768.   2.5.5.  cat
  769.  
  770.   One might think what cat, the sometimes overused concatenating
  771.   utility, has to do with playing sounds.  I'll show a use of it through
  772.   an example.
  773.  
  774.  
  775.  
  776.        $ cat sample.voc > /dev/dsp
  777.        $ cat sample.wav > /dev/dsp
  778.        $ cat sample.au > /dev/audio
  779.  
  780.  
  781.  
  782.  
  783.  
  784.   Doing a cat of an .au file to /dev/audio will usually work, and if
  785.   you're lucky enough that the file has the correct byte order (for your
  786.   platform) etc., a cat of a sound file that uses PCM samples (like .wav
  787.   or .voc) to /dev/dsp might even sound right.
  788.  
  789.   This isn't a totally useless use of cat.  It might be useful, for
  790.   example, if you have a sound file that none of your programs
  791.   recognize, and you know that it uses PCM samples, then you might be
  792.   able to get a very approximate idea on how it sounds like this way (if
  793.   you're lucky).
  794.  
  795.  
  796.  
  797.   3.  Other useful sound utilities
  798.  
  799.   This section has nothing to do with the actual playing of sound files.
  800.   Rather, it is a collection of some sound utilities that one might find
  801.   useful.
  802.  
  803.  
  804.   3.1.  volume
  805.  
  806.   This is a simple command line interface for controlling the volume
  807.   (what else could it be?).  It also has a separate program with a
  808.   Tcl/Tk interface included in the package for controlling the volume
  809.   and playing .au sound files.  A very simple Tcl/Tk CD player is also
  810.   included.
  811.  
  812.   This is Freeware and it is written by Sam Lantinga
  813.   (slouken@cs.ucdavis.edu).
  814.  
  815.   It can be obtained from
  816.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/soundcard/volume-2.1.tar.gz>.
  817.  
  818.  
  819.  
  820.   3.2.  Sound Studio
  821.  
  822.   This is a Tcl/Tk application that supports playback, recording, and
  823.   editing of digital sound using sox.  It includes sox in the
  824.   distribution to avoid compatibility problems.
  825.  
  826.   This was written by Paul Sharpe and N. J. Bailey
  827.   (N.J.Bailey@leeds.ac.uk).  It may be freely used and redistributed if
  828.   a postcard is sent.
  829.  
  830.  
  831.   It can be found at Sound Studio's home page <http://www.elec-
  832.   eng.leeds.ac.uk/staff/een6njb/Software/Studio/screens.html>.
  833.  
  834.  
  835.  
  836.   3.3.  Tickle Music
  837.  
  838.   This beta Tcl/Tk program is a music file browser that allows you to
  839.   play various sound formats as long as an appropriate program to play
  840.   it is on your system.  By default gmod is used for playing MOD files
  841.   and mp for playing MIDI files (you can change the source to use other
  842.   programs).
  843.  
  844.   It is written and copyrighted by Shannon Hendrix (shendrix@pcs.cnu.edu
  845.   or shendrix@escape.widomaker.com).
  846.  
  847.   It can be obtained from
  848.   <ftp://sunsite.unc.edu/pub/Linux/apps/sound/players/tmusic-1.0.tar.gz>.
  849.  
  850.  
  851.  
  852.   4.  References
  853.  
  854.  
  855.   1. The documentation included with the applications in this document.
  856.  
  857.   2. The Linux Sound HOWTO.  It can be found at the Linux Documentation
  858.      Project <http://sunsite.unc.edu/LDP/>.
  859.   3. Linux MIDI and Sound Applications
  860.      <http://www.bright.net/~dlphilp/linux_soundapps.html>
  861.  
  862.   4. Programmer's Guide to OSS <http://www.4front-tech.com/pguide/>
  863.  
  864.   5. SoX home page <http://www.spies.com/Sox/>
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.