Iam trying to merge two .wav files into another file. but I could see only first file's data in the created file.
but the newly created file occupies the space which is equals the sum of the size of the source files.
foreach (string sourceFile in fileNamesList)
{
FileStream file= File.Open(sourceFile, FileMode.Open);
FileStream outFile = File.Open(output, FileMode.Append,FileAccess.Write);
byte[] buffer = new byte[file.Length];
int read;
if ((read=file.Read(buffer, 0, (int)file.Length))>0)
{
outFile.Write(buffer, 0, read);
}
file.Close();
file.Dispose();
outFile.Close();
outFile.Dispose();
}
thanks