12345678910111213141516171819 |
- // Play with:
- // ./program | sox -t raw -r 44100 -b 16 -c 1 -e unsigned-integer -B - -d
- #include <stdio.h>
- int main()
- {
- double t;
- for (t = 0; ; t += .18140589569160998)
- {
- unsigned sample;
- unsigned mul = ((unsigned)(t*4096)|(unsigned)(t*65536)) & (63*16777216)
- & (unsigned)(t*1048576);
- sample = (unsigned)((mul * t) / 65536);
- putchar((sample >> 8) & 0xFF);
- putchar(sample & 0xFF);
- }
- return 0;
- }
|