buffer - OpenAL Soft - Loop with Intro -


i have been using openal soft win32, , i ran particular problem.

my goal play looping sound has one-shot intro portion, similar .wav file loop marker. understand it, must achieved in openal using multiple buffers on source. in general, approach queue both buffers, wait until second buffer playing, , set source loop. works, problem once ready stop sound, don't seem able unqueue last buffer. code looks this:

// set sound alsourcequeuebuffers(source, 1, &buffer1); alsourcequeuebuffers(source, 1, &buffer2); alsourceplay(source);  ...  // check loop sound in update alint buffer; algetsourcei(source, al_buffer, &buffer); if (buffer == buffer2) {     alsourcei(source, al_looping, true); }  ..  // check stop sound in update if (shouldstop) {     alsourcei(source, al_looping, false);     alsourcestop(source);      alsourceunqueuebuffers(source, 1, &buffer1);     alsourceunqueuebuffers(source, 1, &buffer2); // al_invalid_operation } 

the result seems buffer not unqueued, , heard next time play source. know typically can unqueue buffer after finished playing, think freely unqueue buffers on stopped sound. wondering if perhaps use of loop flag causing behavior?

i'd appreciate advice.

thank you, mike

it looks there way around this. can't unqueue playing buffer, can clear out queue line:

alsourcei(source, al_buffer, al_none); 

this work fine after stopping sound.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -