SHARE
TWEET

Untitled

a guest May 20th, 2019 51 in 1 day
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int main(int argc, char* argv[]){
  2.     char* filename = argv[1];
  3.     int counter = 0;
  4.     FILE* in;
  5.     FILE* out;
  6.     in = fopen(filename, "r");
  7.     out = fopen(strcat(filename, "_transformed.wav"), "w");
  8.  
  9.     //ringbuffer initialisieren
  10.     int* ringbuffer = new int[8000];
  11.     for(int i = 0; i < 8000; i++){
  12.         ringbuffer[i] = 0;
  13.     }
  14.  
  15.     //header ├╝bertragen
  16.     for(int i = 0; i<44; i++){
  17.         int value = fgetc(in);
  18.         fprintf(out, "%c", value);
  19.     }
  20.  
  21.     int value, printvalue;
  22.     while(!feof(in)){
  23.         value = fgetc(in);
  24.     //  printf("%i\n", counter);
  25.         printvalue = value + ringbuffer[counter % 8000];
  26.     //  printf("%x\n", printvalue);
  27.         fprintf(out, "%c", printvalue);
  28.         ringbuffer[counter % 8000] = value;
  29.         counter++;
  30.     };
  31.  
  32.     delete[] ringbuffer;
  33.     return 0;
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top