Wave files store a stream of samples. Typically each sample is either one byte (if 8-bit audio) or 2 bytes (if 16-bit audio).
With a mono file, there is one channel, so there is only one sequence of samples:
SSSSSSSSSS
In a stereo file, there are two channels (left and right), and they are stored interleaved, which means the file alternates between left and right samples:
LRLRLRLRLRLRLRLRLRLR
All it takes to convert a mono wav to a stereo wav is:
1) modify the header to indicate the file is stereo
2) duplicate each sample (so you turn a single sample 'S' into two samples 'L' and 'R')
The assignment states we have to create an array that splits it into two and then we have to create a processor which will take in stereo signal.
I am not sure how that is all done. I have created an array but am unsure what to add in it and I have created processors as well that will delay the sound.
for (int i = 0; i < NumChannels; i++) buffers[i] = new short[NumSamples]{
}
for (int i = 0; i < NumSamples; i ++) {
for (int j = 0; j < NumChannels; j++){
}
}
protected:
};
// Main entry point
int main()
{
Wave inputWave;
bool success = inputWave.openWave(INPUT_WAVEFILE);
if(!success){
exit(1);
}