« Return to Thread: Trouble with more than 2 buffers at the same time

Re: Trouble with more than 2 buffers at the same time

by Chris Robinson-5 :: Rate this Message:

Reply to Author | View in Thread

On Sunday 28 June 2009 6:48:18 am Mateus Interciso wrote:
> Hi all, I'm trying to create a program that builds a 16x16 grid, each
> one with one buffer created with alutCreateBufferWaveform(), and it goes
> OK, but if I then play more than 2 buffers at the same time (ie: 3 or
> more) all I get is a white noise, here's the two functions (one to fill
> the grid, and the other to add a sound source, each cell is one), please
> help me out on this.

My only real comment here is that you seem to be leaking buffers. You create
an array of them here:

>   memset(m_vBuffers,'\0',sizeof(ALuint)*m_siBuffers);
>   alGenBuffers(m_siBuffers, m_vBuffers);

Then overwrite/leak the handles in the following loop:

>   for(int i = 0; i < step; i++)
>   {
>     ALfloat f = freq*(i+1);
>     f/=2;
>     m_vBuffers[i] = alutCreateBufferWaveform(ALUT_WAVEFORM_SINE,f, 0,
> duration);
>     if(m_vBuffers[i] == AL_NONE)
>     {
>       logALError(alGetError());
>       return false;
>     }
>   }

As for the static.. what OS and lib version are you using? What's your sound
card?
_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

 « Return to Thread: Trouble with more than 2 buffers at the same time