Original Post
Here i am reading the sound data chunk part of a wav file:
16bit, 2 channels
The sound is a music with all kinds of frequencies.
[source lang="cpp"]short p1[2]; //array were a sample of sound will be, right and left sound.
for(int i=0; i < 1000000 ;i++)
{
fread(&p1,sizeof(short),2,fp);
}[/source]
so after this i am debuging the for loop, checking the value of p1[0] and p1[1]
Logically the value should be between -[color=#000000][background=rgb(183, 203, 237)]32768 and [/background][color=#000000][background=rgb(183, 203, 237)]32767[/background] but it just goes between like -67 to 20.
why is that?
I made the soundfile with code and i can play it in windows media, so i know the data should have a -[color=#000000][background=rgb(183, 203, 237)]32768 or [/background][color=#000000][background=rgb(183, 203, 237)]32767[/background] somehere but it doesnt.
OOPS posted in game programming it was for general programming.how can i move it.
16bit, 2 channels
The sound is a music with all kinds of frequencies.
[source lang="cpp"]short p1[2]; //array were a sample of sound will be, right and left sound.
for(int i=0; i < 1000000 ;i++)
{
fread(&p1,sizeof(short),2,fp);
}[/source]
so after this i am debuging the for loop, checking the value of p1[0] and p1[1]
Logically the value should be between -[color=#000000][background=rgb(183, 203, 237)]32768 and [/background][color=#000000][background=rgb(183, 203, 237)]32767[/background] but it just goes between like -67 to 20.
why is that?
I made the soundfile with code and i can play it in windows media, so i know the data should have a -[color=#000000][background=rgb(183, 203, 237)]32768 or [/background][color=#000000][background=rgb(183, 203, 237)]32767[/background] somehere but it doesnt.
OOPS posted in game programming it was for general programming.how can i move it.