[comp.sys.sun] Standalone sound player for SS1

gopstein@rutgers.edu (Rich Gopstein) (11/09/89)

The following ed script will convert /usr/demo/sound/sound.c into a
standalone program to play sound files on the Sparkstation I.  Save the
script into "patchfile" and issue the following command:

ed /usr/demo/sound/sound.c < patchfile

The version of sound.c that this works on is:
-rw-r--r--  1 bin         37759 May 25 22:58 sound.c

This will create play.c in the current directory.  Just "cc -o play play.c"
to compile.  Its use is "play [-v volume] soundfile" where volume is 0-10,
the default is 7.  Since it doesn't use the screen, it will work with rsh.

If anyone wants it, I have a quick-hack program to convert 8-bit binary
sampled audio (like the MAC uses) into the u-law format for the SS1,
but it is not very user-friendly.

Rich Gopstein
..!rutgers!soleil!gopstein

[[ Ed's Note: included because it was so short :) -bdg ]]

--------------------------------Cut Here-----------------------------------
1848,1854d
1709,1833d
1705c
		strcpy(Buffer.directory, ".");

John_E_Little@cup.portal.com (11/21/89)

Here's another way to make a standalone sound file player for the
Sparcstation 1:

	cat file.au > /dev/audio

The audio device resets the various hardware registers on the last close.
This means that you can do things like start the sound program, select the
speaker and change the volume, then use cat to send files to the device
and get the previously selected options.  As long as sound is running (it
can be iconic), you get the selected characteristics.  The chip has a
bunch of unused capabilities, including single and dual tone generators
(you can get DTMF), a bunch of gain controls, and the completely unused
ISDN capabilities.   Device ioctl calls give you complete access to all of
the chip's registers (even the ISDN ones) so you can experiment to your
heart's content.

You could also write a small program that just twiddles chip registers,
then use cat for all of your actual output. 

	John Little
	jel@cup.portal.com