program.c 431 B

12345678910111213141516171819
  1. // Play with:
  2. // ./program | sox -t raw -r 44100 -b 16 -c 1 -e unsigned-integer -B - -d
  3. #include <stdio.h>
  4. int main()
  5. {
  6. double t;
  7. for (t = 0; ; t += .18140589569160998)
  8. {
  9. unsigned sample;
  10. unsigned mul = ((unsigned)(t*4096)|(unsigned)(t*65536)) & (63*16777216)
  11. & (unsigned)(t*1048576);
  12. sample = (unsigned)((mul * t) / 65536);
  13. putchar((sample >> 8) & 0xFF);
  14. putchar(sample & 0xFF);
  15. }
  16. return 0;
  17. }