aplayprogram to play sounds. AF is not directly supported by Ptolemy, but is nonetheless useful.
soxprogram converts files between various formats.
workmanprogram can play audio CDs on Sun SparcStations.
/dev/audio. The Solaris2.x
/usr/openwin/bin/audiotoolprogram can be used to control the record and play volume and the input and output sources. In Ptolemy 0.7 and later, the SDF Play star writes the appropriate
Most Sun workstations can only play 8 bit u-law audio at 8khz. Sun UltraSparcs can play a range of audio formats: 8 bit u-law, 8 bit A-law and 16 bit linear. UltraSparcs can also play a range of sample rates, including CD (44.1khz) and DAT (48khz).
/usr/demo/SOUNDcontains sample sounds and programs. See
/usr/demo/SOUND/bin/soundtoolfor a graphical sound program with a slightly different interface. For further information about audio on Sun workstations, see the man pages in
/usr/demo/SOUND/man, and the man pages for
workmanprogram can play audio CD's via the Sun SparcStation CD-ROM drive. workman can be configured to use the Solaris
volmgtprogram so that when an audio CD is inserted into the drive it is automatically played. Only the Sparc5 and a few obscure Sparc10s can get audio from the CD directly.Most other Sparcs can use a mini jump plug from the headphone jack on the CD-ROM to the line in on the back of the machine. You can then use audiotool to control the inputs and outputs. Look under the
Volumemenu button for the proper controls. It may take a few minutes to adjust the levels appropriately. The
workmanprogram can be used as an audio source with the CGC Tycho demos (see "Tycho Demos" on page 14-27) to demonstrate the various audio effects.
Under HPUX10.x, the
/opt/audio/bin/audio_editor program can play sounds. Under HPXU9.x, use
2.10.4 Playing Audio over the Network
If you use Ptolemy to create audio files, then you may want to share them with others over the network.There are several ways to play audio over the network, we discuss them below.
Via the Web
Audio files can be placed on HTML pages and played by many HTML browsers over the network. There are many proprietary commercial server packages that allow users to listen to audio via their browser, we do not cover those packages here, instead we discuss two common formats:
.wav. In general, SparcStations can directly play only
.au files and Windows and Macintosh machines can play both
.wav files. If you use Ptolemy to generate a
.au file, the file must have a proper header. The SDF
Play star will generate that header for you.
xplaygizmo and AudioFile
aplay programs to play audio files via a browser. To set this up, place the following in the
.mailcap file in your home directory and restart your browser.
audio/*; xplaygizmo -p -q /usr/sww/AF/bin/aplay; stream-buffer-size=2000
On the Macintosh to play the
.au files under Netscape, you may need to install a sound program. If you are using the "Berkeley Internet Kit", then you probably already have installed a program
SoundApp that can play the Sun audio files. However, Netscape may not be configured to use it. You can change this by selecting
Preferences from the
Options menu, and selecting the
Helpers page within that. Under
ULAW audio, you should set the file type to
ULAW and the application program to
Java can play
.au files over the net, but again, these files must have a proper header.
The AudioFile program
AF is a audio server that allows a user to listen to a sound generated on a remote machine. See the link above for more information.
2.10.5 Ptolemy Sounds
You can try playing sounds with the universe you just created. Replace the
XMgraph star in
waveform window with an instance of the
Play star (second row of the sinks palette, right of center, with a stylized loudspeaker as an icon). Edit the parameters of the
Play star entering 16000 for the gain parameter. (To see details about the
Play star, execute the "profile" command in the "Other" menu, or type a comma (",") with the mouse on the
Play icon). The SPARCstation's speaker is driven by a codec that operates at an 8 kHz sample rate. So running this universe for 40000 samples will produce about 5 seconds of sound. The sound produced by the current parameters is not particularly attractive. Experiment with different parameter values. Try PI/1000 in place of the PI/50.
sinegen instances with something that generates a chirp, and again experiment with parameters.
Integrator and a
Sin, connected in series. The step parameter of the
Ramp should be very small, such as 0.0001. With this value, you will hear some aliasing if you create five seconds of sound. The
Integrator is in the "arithmetic" palette, furthest on the right, and its default parameter values are fine for this purpose. Use the "profile" command (",") to read about it. Note that a fourth star, a
Const (second star in "sources" palette) is needed to set the
Integrator reset input to zero.