116
#include <netaudio.h>
#include <defaults.h>
main(argc,argv)
int argc;
char *argv[];
{
NAport *port;
NAinfo info;
/* Initialize '.datlinkrc' processing */
InitDefaults(argv[0]);
/* Fill 'buffer' with 'samples' samples of audio data */
/* Open connection to DAT-Link server */
port = NAOpen(0);
NAGetDefaultInfo(&info);
/* Set sampling rate to 8000 samples/second */
info.playback.sampleRate = 8000;
/* Set for stereo playback */
info.playback.channels = NA_CHANNELS_STEREO;
/* Set for gain of 2.0 */
info.playback.gain = 2.0;
NASetInfo(port,&info);
/* Open data connection */
NAOpenData(port,NA_PLAY);
/* Send the audio data */
NAWrite(port, (char *)buffer, samples*2);
/* Start playback */
NABegin(port,NA_PLAY);
/* Wait for playback to finish */
NADrain(port);
/* Close connection to server */
NAClose(port);
}
Subroutine Library
Need help?
Do you have a question about the DAT-Link and is the answer not in the manual?