source: trunk/third/esound/TIPS @ 15363

Revision 15363, 2.8 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15362, which included commits to RCS files with non-trunk default branches.
Line 
1Playing back "other" sound formats:
2-----------------------------------
3
4The esdplay utility can be used to play a variety of audio files.
5However, it can't play everything.  The sox utility understands
6many more types of audio files.
7
8The sound utility, sox, can be used with esd in primarily two ways.
9
10Method 1:  use sox to convert the file format ahead of time.
11Method 2:  use sox to generate output on stdout, and pipe into esdcat
12
13For accurate playback using either method, be sure to match the
14audio format (size/signedness of data, number of channels, and
15sample rate) between sox and esd.  Converting mono to stereo, or
16changing the sampling rate with sox is probably not necessary for
17live playback, as it will have little effect on sound quality,
18and merely chew up additional CPU.  For example to play back a sample
19that was recorded in Sun audio format (.au), mono, at 8000 Hz, using
20esdcat, type the following:
21
22sox sample.au -c 1 -r 8000 -t ub - | esdcat -b -m -r 8000
23
24sox arguments:  -t ub   = data type unsigned byte
25                -c 1    = mono
26                -r 8000 = sample rate 8000 Hz
27                -       = output file
28
29esdcat arguments: -b    = data type unsigned byte
30                -m      = mono
31                -r 8000 = sample rate 8000 Hz
32
33Currently, esd only supports unsigned byte, and signed word data types.
34
35
36Playing back mp3 files:
37-----------------------
38From Wayne Johnson,
39mpg123 -s sample.mp3 | esdcat
40
41NOTE: recent versions of mpg123 support esd directly.
42Type "make" to see possible executable varieties.
43
44
45Checking recording capabilities:
46--------------------------------
47
48To make sure the recoding works, try this WITHOUT esd running:
49
50dd bs=8k count=4 </dev/audio > sample.au
51
52
53Cthugha - An Oscilloscope on Acid
54---------------------------------
55
56version 1.2:
57
58    esd
59    xcthugha --listen
60    esdmon > /tmp/cthugha.com
61
62NOTE: xcthugha may complain about:
63Can't open `/dev/dsp' for writing. (16 - Device or resource busy)
64No problem, keep on truckin'. esd gets the sound device, and
65cthugha gets the data it needs.
66
67version 1.3:
68
69    mkfifo /tmp/cthugha.esd
70    xcthugha --play /tmp/cthugha.esd --silent &
71    esdmon > /tmp/cthugha.esd
72
73ESD auto spawning:
74------------------
75
76libesd will automaticall spawn esd if it's not available when an esd using
77application opens a connection to esd. By default the command issued is:
78esd -terminate -nobeeps -as 2
79BUT
80if you wish to use different options, you can set the
81ESD_SPAWN_OPTIONS
82environment variable that will contain the options passed to esd.
83for example - if I:
84export ESD_SPAWN_OPTIONS="-terminate -nobeeps"
85esd is run with:
86esd -terminate -nobeeps
87
88if you set the environment variable (contents are irrelevant) called
89ESD_NO_SPAWN
90libesd will not attempt to spawn esd. and simply fail to connect.
91
92You can also put these settings in $(sysconfdir)/esd.conf, or ~/.esd.conf.
93See $(sysconfdir)/esd.conf for an example of how to make the config file.
Note: See TracBrowser for help on using the repository browser.