File: sound.doc

package info (click to toggle)
ctwm 3.7-3.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 6,420 kB
  • ctags: 3,180
  • sloc: ansic: 26,429; yacc: 1,004; lex: 147; makefile: 55; sh: 32
file content (104 lines) | stat: -rw-r--r-- 3,991 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Here are some rplay sound patches for ctwm 3.0.  Just in case you don't know
what rplay is, here's some information from the README file:

[README INFO]
WHAT IS RPLAY?
--------------
rplay is a sound package that supports both local and remote sound control.
rplay is based on client/server communication using two protocols.  The first
protocol that can be used is RPLAY, which is UDP based and allows sounds to
be played, paused, continued, and stopped.  The second protocol is RPTP
(the Remote Play Transfer Protocol) which is TCP based and allows sounds to be
played, paused, continued, stopped, and transferred.

The rplay system can be described as follows.  An rplay client sends an RPLAY
UDP packet to an rplay server.  The RPLAY packet sent contains the name of a
sound file and various other sound attributes.  The rplay server receives the
RPLAY packet and looks up the sound in a sound file database.  If the sound
is found in the database it will be immediately played on the host the rplay
server is running on.  If the sound is not found in the database the rplay
server can be configured to search other rplay servers for the desired sound
file.   rplay servers communicate using the RPTP protocol.  rplay clients can
also use RPTP to upload sounds to an rplay server.  When an rplay server
receives sounds from a server or a client the sounds are stored in a sound 
cache directory.  The size in bytes of the cache directory can be limited
by the rplay server.  When the cache is full, the rplay server will remove
sounds using a "least recently used" algorithm.  Sound files that are larger
than the maximum cache size will not be accepted by the rplay server.

rplay can be used to easily add sound to any application.  For example,
if you want to play a sound when a button is pressed, all you need to do
is this:

	rplay_local("sound_name.au");

If you want to specify a hostname:

	rplay_host("bozo.sdsu.edu", "sound_name.au");

The above routines along with many others are included in the rplay library.
See the KNOWN RPLAY APPLICATIONS section of this file for a list of applications
that use the rplay library.

Currently the rplay server only supports u-law 8000hz sound files.

PORTING:
--------
rplay is known to work on the following systems:

   * Sun SPARCstations running SunOS 4.1.x

   * Sun SPARCstations running Solaris 2.x

   * HP-UX

   * Linux

   * BSDI/386

   * 386bsd using Steve Haehnichen's soundblaster driver version 1.5

   * SGI Indigo

All rplay requires is an audio device where sounds can be played using the 
write system call.  For example, if you can "cat sound_file > /dev/audio",
then rplay should work.  If your system has an audio device that does not work 
with the above "cat" command, there is still hope but you might need to do some
programming.  You will probably only need to modify rplayd/audio.c.
If you port rplay to another system please send me patches.
[END OF README INFO]

rplay support has been added to the olvwm, twm, tvtwm, and ctwm window managers
and many games like XTank, XPilot, and XBoing just to name a few.

If you are interested, you can obtain rplay at sounds.sdsu.edu in the /pub/rplay
directory or I can mail you a copy.

I would also like to give proper credit for the window manager patches.
Olvwm patches where originally implemented by Andrew "Ender" Scherpbier (Andrew@SDSU.Edu)
and were later modified to support tvtwm and twm by J.E. Sacco (jsacco @ssl.com).
I slightly modified the tvtwm patches to support ctwm.

Oops, I forgot to tell you what has been changed in ctwm.  Two new functions have
been added:

	f.rereadsounds	- rereads the .ctwm-sounds file
	f.togglesound	- turns on/off the sound

and I added:

	SoundHost "hostname"	- where hostname is the host to play sounds on.

The .ctwm-sounds file has the following format <X Event> <sound>:

KeyPress:	Cork.au
MapNotify:	turbbeep.au
ResizeRequest:	failure.au
Startup:	2lust.au
Shutdown:	1sadeness.au

-- 
Mark Boyns
boyns@sdsu.edu