next up previous contents
Next: Example: translate Up: GRASP Routines: General purpose Previous: Example: makesounds program   Contents

Function: sound()

0 sound(short *array,int n,char *name,int filenumber)

This is just like the function audio() except that it writes the sound data into a file of the form *.au.

The arguments are:

array: Input. The array that you want to hear.
n: Input. The number of array elements that you want to hear. The elements used are array[0..n-1].
name: Input. Used to construct the output file name.
filenumber: Input. The value of $y$ used to construct the output file name.

This function produces an output file with 16-bit PCM linear coding, containing sound data. The name of the file is: name.$y$.au where $y$ is the integer specified by filenumber. Note that if $y<1000$ then $y$ is ``expanded" or ``padded" to three digits. For example, calling
sound(array,4800,"growl",9)
will produce the file
growl.009.au
containing $1/2$ second of sound.

Note: see the Warning that goes with audio().

Authors: Bruce Allen, ballen@dirac.phys.uwm.edu
Comments: This routine could be modified to permit a bit more freedom in setting the volume and/or the sample rate.


next up previous contents
Next: Example: translate Up: GRASP Routines: General purpose Previous: Example: makesounds program   Contents
Bruce Allen 2000-11-19