+ else if(!strcmp(name, "s")) {
+ samplerate = atoi(val);
+ if(samplerate > 5000 && samplerate < 6000)
+ samplerate = 5512;
+ else if(samplerate > 11000 && samplerate < 12000)
+ samplerate = 11025;
+ else if(samplerate > 22000 && samplerate < 23000)
+ samplerate = 22050;
+ else if(samplerate > 44000 && samplerate < 45000)
+ samplerate = 44100;
+ else {
+ fprintf(stderr, "Invalid samplerate: %d\n", samplerate);
+ fprintf(stderr, "Allowed values: 11025, 22050, 44100\n", samplerate);
+ exit(1);
+ }
+ return 1;
+ }