Hello everyone! first of all,i have to say i'm using OpenAL for playing my sounds.
I'm creating a 3D environment to display urban developments.
I want to play a wav file (steps) while the user is moving inside the environment and don't play it while is standing still.
that's the bit of code i wrote to achieve this outcome
int j=0; float x[j],y[j]; float xmov,ymov;
for(;;j++){ xmov=x[j+1]-x[j]; ymov=y[j+1]-y[j]; if(xmov!=0 || ymov!=0) alSourcei(g_sources[2],AL_LOOPING,AL_TRUE),alSourcePlay(g_sources[2]); else alSourcei(g_sources[2],AL_LOOPING,AL_FALSE); Sleep(250); }
it doesn't give me any error...but it doesn't work too.
I didn't set any limit to j as i want it to loop endlessly. is this the problem?
|