I have a what seems to be an easy problem yet I can’t seem to get the results I want.
According to the Wav Format, a 16-bit wav file is signed and values range from -32768 to 32767. Yet I can only seem to be getting positive integers, what am I missing?
Here’s a screenshot of the few bits of data I outputted:


- Additionally, can someone explain how to tell apart the right channel data and left channel data? I can’t seem to find enough examples of this. Thanks.
Here’s the code I used, wav.getFile() returns the file pointer exactly after reading all the other header data.
int SoundData;
for( int i = 0; i < 32; i++ )
{
fread( &SoundData, 4, 1, wav.getFile() );
cout << SoundData << endl;
}
Thanks in advance everyone.
Does changing
SoundDatato ashort inthelp?