i'm trying to merge two wav files. i have been trying to do this for around 5 hours, but i havent been able to . i tried so many things using file handling , opening in binary mode,etc . but i havent been able to merge two wav files. I was able so separate the header data from the sound data and merge them back but i was not able to merge 2 wave files .. this is my code for what i have done... can anyone please help me out?
int main()
{
ifstream binheaderFileA("headerh",ios::binary); // for reading the header file
ifstream bindataFileA("datah",ios::binary) ; // data from first sound file
ifstream bindataFileB("datae",ios::binary); // data from second sound file
Also, what do you mean by "merge"? Do you mean you want to append one at the end of the other? Or do you want to mix them so they both play simultaneously? Or something else?
sorry about that .. i didn't know there was something like that .. i will from now on..
i want to append one at the end of the other . But after doing some research i found that i should make changes in the header file in order to add more data to the end of the original file. I tried one method( which is actually trial and error . i found out the byte where the size of the data chunk is stored and i modified it to a larger value. here is the following modification. logically is correct but i dont think this is the right way to do it.