
Untitled
By: a guest on
Jun 26th, 2012 | syntax:
None | size: 0.98 KB | hits: 8 | expires: Never
Audio Manipulation In C
#include <iostream>
using namespace std;
class main() //function start
{
string fileinput; //variable
string outlocation; //variable
cout << "please type file path directory: n n";
cin >> fileinput; //navigate to file by typing
cout << "Where would you like to save new file? n n";
cin >> outlocation; //select output by typing
// Then all the maths and manipulation is done
cout << "Your file has been created at ";
cout << outlocation;
cout << "n n";
system("pause");
return 0;
}
ifstream myFile ("example.wav", ios::in | ios::binary);
char buffer[12];
myFile.read (buffer, 12); // skip RIFF header
char chunkName[5];
unsigned long chunksize;
while (myFile.read (chunkName, 4)) {
chunkName[4]=' '; // add trailing zero
myFile.read((char*)&chunksize, 4);
// if chunkname is 'fmt ' or 'data' process it here,
// otherwise skip any unknown chunk:
myFile.seekg(chunksize, ios_base::cur);
}