[Openal] double buffering and context
toby z
dyavolo_blu at yahoo.co.uk
Tue Jun 28 07:33:58 PDT 2005
Hi guys,
I'm stuck with my code, yes, again :(
alBufferData doenst load my files, the only reason I
can think of is, its a vector and not just ALuint,
does that keep it from loading my files :|
whats wrong with this little bit, I am still 'trying'
to get queuing to work for me, if only I get this bit
done that is.
Thanks alot guys,
Toby.
ALuint buffer;
for (ALuint index=0; index<NUM_BUFFERS; index++){
buff_q_arr.push_back(buffer); // defined vector
<ALuint> buff_q_arr;
// load src file(s)
sprintf(str, "%u.wav", oct_note[index]); // defined
ALuint oct_note[NUM_BUFFERS] =
{60,62,64,65,67,69,71,72};
printf("from sprintf the files are: %s", str);
cout << "\n\nloading source files now for buffer" <<
buff_q_arr[index] <<endl;
cout << "BUF_NUM: " << index << endl;
cout << "FILE: " << oct_note[index] << endl;
alutLoadWAVFile(str, &format, &data, &size, &freq,
&al_bool);
if (alGetError() != AL_NO_ERROR){
cout << "\n* src not loaded @ alutLoadWavFile \t
source_name:" << source[index] << endl;
return AL_FALSE;
}
else{
cout << "\nsrc loaded @ alutLoadWavFile \t
source_name:" << str << endl;
}
/* culpret : doenst load the files */
alBufferData(buff_q_arr[index], format, data, size,
freq);
if (alGetError() != AL_NO_ERROR){
cout << "\n* src not loaded @ alBufferData \t
source_name:" << str << endl;
return AL_FALSE;
}
else{
cout << "src loaded @ alBufferData \t source_name:"
<< str << endl;
}
alutUnloadWAV(format,data,size,freq);
if (alGetError() != AL_NO_ERROR){
cout << "\n* src not UN-loaded @ alutUnloadWav \t
source_name:" << str << endl;
return AL_FALSE;
}
else{
cout << "src UN-loaded @ alutUnloadWav \t
source_name:" << str << endl;
}
buffer++;
}
alGetError(); // clear ALL errors
--- Garin Hiebert <garinh at cheesetoast.net> wrote:
> > I hope I have made some sense here and I'm trying
> out
> > the streaming test. It might do the job for me.
>
> I'm still not very clear on the problem, but I think
> you will want to
> look at queueing -- it's the only way in OpenAL to
> get continuous
> playback across multiple buffers.
>
> Garin
>
>
___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
More information about the Openal
mailing list