|
|
Sample Programs from NeXSTEP 3.3
/*
* converttest.c - an example conversion that takes an mulaw codec file
* as input and writes a new file (11 times bigger) that is the equivalent
* 22kHz stereo 16 bit linear soundfile
*/
#import <sound/sound.h>
#import <stdio.h>
check_error(int err)
{
if (err) {
printf("Error : %s\n",SNDSoundError(err));
exit(1);
}
return err;
}
main (int argc, char *argv[])
{
int err;
SNDSoundStruct *s1, *s2;
SNDSoundStruct header = {
SND_MAGIC, 0, 0, SND_FORMAT_LINEAR_16, (int)SND_RATE_LOW, 2, "" };
check_error(argc != 3);
err = SNDReadSoundfile(argv[1],&s1);
check_error(err);
s2 = &header;
err = SNDConvertSound(s1,&s2);
check_error(err);
err = SNDWriteSoundfile(argv[2],s2);
check_error(err);
exit(0);
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.