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?

  1. Start up VSS.
  2. Change to the directory parambiences.
  3. Then do one of the following (or several at once, for that matter): (You can find the program audpanel in the directory where VSS is installed.)
  4. 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?

  1. In your source file containing the call to main(), make the following changes.
    1. Near the beginning of the file, add this line:
      #include "/afs/ncsa/packages/vss/6.5/vssClient.h"
    2. Near the beginning of main(), add these lines:
      BeginSoundServer();
      AUDinit("windparam.aud");
    3. Near the end of main(), add this line:
      EndSoundServer();
    4. 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".
    5. 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".
  2. In your makefile, add /afs/ncsa/packages/vss/6.5/libsnd.a to the link command that builds your application.
  3. The files vssClient.h and libsnd.a are part of the VSS download.
  4. If your application is straight C with no C++, link with CC or g++ instead of cc or gcc or ld.
  5. Rebuild your application.
  6. Copy windparam.aud to the directory your application runs from.
  7. Now you can run your application.

[ up to main page ]


Back: Ambient sound.

Next: Sonifying your data.