2

I'm developing an audiotool that plays 64 Audiosources simultaneously. Therefore I created four arrays containing 16 Audiosources each. Each array of Audiosources is routed to its own Mixer. Furthermore, two mixer output to the left channel, two to the right. My DSP Buffer Size is set to Best Performance, meaning 1024 samples and there are enough real / virtual voices available.

In the beginning, 60 Audiosources are set to Volume = 0, while four of them are running with Volume = 0.5. Each Update()-Frame, I set the Volume of those playing with 0.5 to zero, therefore setting four new audiosources that were zero before to 0.5.

Something like this:

void SwitchSources()
 {
     noseposInd++;
     if (noseposInd > 15) noseposInd = 0;

     audioSources_Lm[noseposIndTemp].volume = 0.0f;
     audioSources_Ln[noseposIndTemp].volume = 0.0f;
     audioSources_Rm[noseposIndTemp].volume = 0.0f;
     audioSources_Rn[noseposIndTemp].volume = 0.0f;

     audioSources_Lm[noseposInd].volume = 0.5f;
     audioSources_Ln[noseposInd].volume = 0.5f;
     audioSources_Rm[noseposInd].volume = 0.5f;
     audioSources_Rn[noseposInd].volume = 0.5f;

     noseposIndTemp = noseposInd;
}

For test purposes, I loaded a rectangle signal with f = 2Hz (results in an audible click per second) into each Audiosource. Recording my output with Audacity results in something that can be seen on the attached photo:

enter image description here

It seems that the buffer of one of the four signals is not written to the output because the amplitude regarding a positive or negative pulse is just half. The width of the "notches" is exactly one blocklength. Meaning 1024 samples with a samplerate of 44.1kHz, so that there is no output for about 23ms.

Increasing the rate of changing the volume also increases the occurences of notches / time outs or however this can be called. Has anyone had the same problem or can help out with some knowledge about how the Update()-Method and the audio-block-writing of the mixers interfere?

Thanks in advance!

Max Lehmer
  • 21
  • 2

0 Answers0