5 int main(int argc, char **argv)
7 unsigned num_samples = atoi(argv[1]);
8 double freq = atof(argv[2]);
10 for (unsigned i = 0; i < num_samples; ++i) {
11 double y = cos(freq * 2.0 * M_PI * (double)(i) / 48000);
12 short ys = (y > 0) ? 16384.0 : -16384.0;
14 fwrite(&ys, sizeof(short), 1, stdout);