Agilent Technologies

Using a Sound Card DLL to Retrieve and Playback Data

SND.DLL
a simple Windows program to retieve and playback Data via your sound-card
=========================================================================

Installation:
=============
The software consists of the files
* SND.DLL - The binary file for Windows
* SND.H - The function definition for AgilentVee
* SND.VEE - An example Vee-Application that illustrates the
usage of the program
Simply extract the two files to a directory. You will need to reference
the directory and the filename from Vee to load the library.

Example Application (SND.VEE):
==============================
The example implements "a computer wire" between the sound-input and the
sound output of your computer.
Data is read from the sound-card. You have to select the input-jack and
the input volume in the Windows Volume Control (Taskbar).
The data is buffered for approx. 50 msec (BufferSize/SampleFreq), displayed
on the screen and output to the sound-card. You have to control the output
volume in the Windows Volume Control.

Function reference:
===================
***********
int snd_initialize(int BitsPerSample, int SampleFrequency,
short ChannelCount, int SamplesPerCycle)

snd_initialize initializes the dll. The parameters have the following meaning:
* BitsPerSample:
Count of bits per sample. Possible Values: 8, 16. (Your Soundcard may also
support 24 Bits. Check your Hardware Manual! The dll supports 24 bits, but
this feature is experimental; i.e. the returned Values may be wrong.)
* SampleFrequency:
Frequency, at which samples are taken. Possible Values: 11025, 22050, 44100.
(Your Soundcard may also support 48000 and 96000. Check your Hardware Manual!)
*ChannelCount:
The count of channels that shall be recorded.
Possible Values: 1 = Mono; 2 = Stereo.
If Mono is selected, snd_recieveStereo will return the same values
in both buffers, but only outputL will be played in snd_sendStereo.
(Though your Soundcard and Soundcard Driver may also support more Channels,
there will be only the first two channels from the PCM-stream that the Card
produces returned. Depending on your Soundcard and Soundcarddriver Results
may differ. Check your Hardware and Software Manual! Values greater than 2
are experimental!)
*BufferSize:
The count of entries in the Buffer that shall be retrieved in on cyle.

***********
int snd_close(void)
stops recording

@param void

@return int 0 if successfull

***********
int snd_sendStereo(int *outputL, int *outputR)
transmits Stereo data for output to Soundcard

@param int *outputL - buffer containing the data for the left channel
@param int *outputR - buffer containing the data for the right channel

@return 0 if successfull, -1 otherwise

***********
int snd_receiveStereo(int *inputL, int *inputR)
recieves data from the soundcard

@param int *inputL - buffer containing the data for the left channel
@param int *inputR - buffer containing the data for the right channel

@return 0 if successfull, -1 otherwise

***********
int isRecording()
// check if ad has been already created

Copyright:
==========
snd.dll is a project of the University of Applied Sciences Hof
(www.fh-hof.de) under direction of Prof.Dr.-Ing. V. Plenk,
(vplenk@fh-hof.de), and was programmed by the following students
* Markus Plietsch, markus.plietsch@fh-hof.de
* Martin Heier, Martin.Heier@FH-Hof.de
* Jens Ebert, Jens.Ebert@fh-hof.de
* Stefan Weber, Stefan.Peter.Weber@fh-hof.de
* Tobias Lutz, tobias.lutz@fh-hof.de
* MBruchner, mbruchner@fh-hof.de

If you find this software useful, please send a note to vplenk@fh-hof.de.

You are free to use and distribute the software if you keep a reference
to the University of Applied Sciences Hof.

More reading / Contact:
=======================
More documentation and the complete source codes can be found at
http://cvs-serv.fh-hof.de/cvsweb/showproject/Sounddrivers
We will use the software for our lab experiments. So you might want
to check the above URL for revised versions.

If you have any questions please contact vplenk@fh-hof.de.


© Agilent 2000-2006