I'm writing a program and I have all of it working properly except the last part, the convert_to_wave function. The problem is that it's in a library, not one that I wrote so I'm not sure what I'm doing wrong. I'm passing in the temp file and it should be converted to my wav file but I receive the error "Error reading input file temp.tmp". It generates a .wav file but I can't get it to play the note. I'm not sure exactly where the error is, my guess is with the input to the function. Am I passing a file in correctly when I call the function? Any suggestions appreciated. If you need more details, I will try and provide them.
for ( i = 0; i < NUM_NOTES ; i++ )
time_new = file_contents[i];
for ( ; time_old < time_new; time_old++ )
for ( j = 0; j < buffer; j++ )
fout << notes[j];