How to add parambient sound to your C or C++ application, using VSS.
Camille Goudeseune
1. Overview
This document explains how to add parambient sound to your application.
It assumes that your application is
written in C or in C++, and that you have a copy of VSS available,
version 3.1 dated 1/1/1999 or later.
It assumes that you've managed to get the simplest level of sound
running as described here.
"Parambient sound" here means a sonic environment, heard in the background,
which has certain attributes you can change while it's playing.
It's ambient and it has parameters; hence it's called parambient.
As before, the sound starts and ends when your application starts and ends.
2. How do I try out the various parambiences?
- Start up VSS.
- Change to the directory parambiences.
- Then do one of the following (or several at once, for that matter):
- audpanel windparam.ap windparam.aud
- audpanel geigerparam.ap geigerparam.aud
(You can find the program audpanel in the directory where
VSS is installed.)
- A window will appear.
Drag the sliders to change the parameters;
click RESET to restore the parameters' default values;
click EXIT to end the sound.
The program audpanel, together with a .ap file, lets you try out a .aud file.
The .ap file acts as the "glue" between the .aud file's message groups
and audpanel's sliders. (More later about message groups.)
Your own application won't use a .ap file: its AUDupdate() calls connect
directly to the .aud file's message groups.
3. How do I add parambient sound to my application?
- In your source file containing the call to main(),
make the following changes.
- Near the beginning of the file, add this line:
#include "/afs/ncsa/packages/vss/6.5/vssClient.h"
- Near the beginning of main(), add these lines:
BeginSoundServer();
AUDinit("windparam.aud");
- Near the end of main(), add this line:
EndSoundServer();
- At any point in the code where you want to change how high or
low the wind sounds, add this line:
AUDupdateSimpleFloats("pitch", 1, xxx); }
replacing xxx with a float or double number between 500.0 (low) and 20000.0 (high).
If this is in a different source file, that file will also
need to #include "/afs/ncsa/packages/vss/6.5/vssClient.h".
- At any point in the code where you want to change how loud
the sound is, add these lines:
AUDupdateSimpleFloats("loudness", 1, xxx); }
replacing xxx with a float or double number between 0.0 (silence) and 1.0 (very loud).
If this is in a different source file, that file will also
need to #include "/afs/ncsa/packages/vss/6.5/vssClient.h".
- In your makefile, add /afs/ncsa/packages/vss/6.5/libsnd.a
to the link command that builds your application.
- The files vssClient.h and libsnd.a are part of the VSS download.
- If your application is straight C with no C++,
link with CC or g++ instead of cc or gcc or ld.
- Rebuild your application.
- Copy windparam.aud to the directory your application runs from.
- Now you can run your application.
[ up to main page ]
Back:
Ambient sound.
Next:
Sonifying your data.