Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.98 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Audio Manipulation In C  
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. class main()    //function start
  6. {
  7.     string fileinput;   //variable
  8.     string outlocation; //variable
  9.  
  10.     cout << "please type file path directory: n n";
  11.     cin >> fileinput;   //navigate to file by typing
  12.  
  13.     cout << "Where would you like to save new file? n n";
  14.     cin >> outlocation; //select output by typing
  15.  
  16.     // Then all the maths and manipulation is done
  17.  
  18.     cout << "Your file has been created at ";
  19.     cout << outlocation;
  20.     cout << "n n";
  21.  
  22.     system("pause");
  23.  
  24.     return 0;
  25. }
  26.        
  27. ifstream myFile ("example.wav", ios::in | ios::binary);
  28. char buffer[12];
  29. myFile.read (buffer, 12); // skip RIFF header
  30.  
  31. char chunkName[5];
  32. unsigned long chunksize;
  33. while (myFile.read (chunkName, 4)) {
  34.     chunkName[4]=''; // add trailing zero
  35.     myFile.read((char*)&chunksize, 4);
  36.  
  37.     // if chunkname is 'fmt ' or 'data' process it here,
  38.     // otherwise skip any unknown chunk:
  39.     myFile.seekg(chunksize, ios_base::cur);
  40. }