0
0

I have two timers that each plays a sequence of sounds. When I play each of them separately, they work fine. But when I play them together, one of the timer sound sequences quickly fades out, and I have no idea why. I am programming in C Win Api and the code is as follows:

[code:19tw9zh9]

static int drumcount = 0;

case WM_TIMER :

  switch (wParam)
  {   
  case 2: 
    beat = talas[seltala].matra[drumcount];
    if ( beat != 0){
    result = FMOD_System_PlaySound(systemx, FMOD_CHANNEL_FREE, sound[beat], 0, &channel[5]);    }

    FMOD_System_Update(system);
    drumcount += 1;
    if(drumcount >= talas[seltala].beats) drumcount = 0;

    break;

  case 1:
    if(timecounter==0){ result = FMOD_System_PlaySound(systemx, FMOD_CHANNEL_FREE, sound[3], 0, &channel[1]);}  
    if(timecounter==2){ result = FMOD_System_PlaySound(systemx, FMOD_CHANNEL_FREE, sound[4], 0, &channel[2]);}
    if(timecounter==3){ result = FMOD_System_PlaySound(systemx, FMOD_CHANNEL_FREE, sound[5], 0, &channel[3]);}
    if(timecounter==4){ result = FMOD_System_PlaySound(systemx, FMOD_CHANNEL_FREE, sound[6], 0, &channel[4]);}

    FMOD_System_Update(system);
    timecounter = timecounter + 1;
    if(timecounter > 5) timecounter = 0;
    break;
  }
return 0; 

[/code:19tw9zh9]

The Case 2 sequence is a series of drum sounds that are each represented by a number from an array, and it is this sequence that quickly fades out when trying to play it together with the Case 1 sequence. I have tried to run Debug, but the only error I can see is "fmodex.dll’, Cannot find or open the PDB file." It would be highly appreciated if someone could give me an idea why the program doesn’t work.

Sincerely
Keitel

  • You must to post comments
0
0

Having thought some more about this, I have come to the conclusion that the code is to demanding on the resources of the computer. So I will rewrite it.

Sincerely
Keitel

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.