I’m trying to write some data to a wav file, but the code hangs when I try to delete the audioFormatWriter object in order to ensure that all data is written. I’m using VS2008 which gives an error which it says may be due to corruption of the heap. Code is show below, and any help is much appreciated.
mark
[code]File outputFile(“C:\Users\wood\Documents\engineering\4yp\testsignals\largeData.wav”);
AudioFormatWriter *wavWriter;
FileOutputStream outputStream(outputFile,false);
wavWriter = wavBase.createWriterFor(&outputStream,96000,2,32,NULL,0);
//Write the data as many times as needed
for (int i=0;i<1;i++){
if(wavWriter->writeFromAudioReader(*wavReader,0,750120)==false){
int j=0;
}
}
//outputStream.flush();
delete wavWriter;[/code]