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