|
|
Sample Programs from NeXSTEP 3.3
/*
* hosttest.c - play a soundfile on one or more named hosts.
*/
#import <sound/sound.h>
#import <stdio.h>
check_error(int err)
{
if (err) {
fprintf(stderr,"Error : %s\n",SNDSoundError(err));
exit(1);
}
}
main (int argc, char *argv[])
{
int err, j;
SNDSoundStruct *s;
if (argc < 3) {
fprintf(stderr,"usage : hosttest file hostname ...\n");
exit(1);
}
for (j=2; j<argc; j++) { //check that all hosts are available
err = SNDSetHost(argv[j]);
check_error(err);
}
err = SNDReadSoundfile(argv[1],&s);
check_error(err);
for (j=2; j<argc; j++) {
err = SNDSetHost(argv[j]);
check_error(err);
err = SNDStartPlaying(s,j,0,0,0,0);
check_error(err);
}
SNDWait(0);
exit(0);
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.