[Openal] Trouble with more than 2 buffers at the same time
Zarnick Maelstorm
zarnick at geekvault.org
Sun Jun 28 18:03:21 PDT 2009
Well, I am overwriting the buffers, that's the ideia right, allocating an
array of buffers and creating the wave sine and holding them in this array?
This buffer is never written over latter in the program (ie: This function
is called only once) Is there any other way for making this?
Also, I'm using Linux, and I've tested this on both M-Audio Audiophile USB
interface and a common nForce audio board (the one on board on some mother
boards), the results are the same.
Zarnick
http://www.geekvault.org
On Sun, Jun 28, 2009 at 9:47 PM, Chris Robinson <chris.kcat at gmail.com>wrote:
> 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 at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal/attachments/20090628/0a42ca80/attachment.html
More information about the Openal
mailing list