logo

bytemedia

Home to byte-level sounds, images, videos, … git clone https://anongit.hacktivis.me/git/bytemedia.git/

au8b_44.1kHz.c (702B)


  1. #define _POSIX_C_SOURCE 200809L
  2. #include <stdio.h>
  3. #include <inttypes.h> // uint32_t
  4. #include "au.h"
  5. int
  6. main(void)
  7. {
  8. struct au_header header = {
  9. .offset = 24, // no-annotation, in octets
  10. .length = 0xFFFFFFFF, // unknown data size
  11. .encoding = 02, // unsigned 8-bit linear PCM
  12. .samplerate = 44100, // Hz
  13. .channels = 1
  14. };
  15. // fd 1 is stdout
  16. write_au_header(1, &header);
  17. for(int t = 0;;t++)putchar(
  18. //((t*("36364689"[t>>13&7]&15))/12&128)+(((((t>>12)^(t>>12)-2)%11*t)/4|t>>13)&127)
  19. //((t*(t>>13&10))/12&128)+
  20. //((((t^t-2)%10*t)/5|t>>14)&127) // happy android stroll ; loops after 2097334 samples
  21. //((((t^t-1)%10*t)/2+(t>>5%16)|t>>9)&127) // evac_alarm ; 44100*5.8 samples is neat
  22. );}