[Openal-devel] Waveform and queued buffers

Daniel PEACOCK dpeacock at creativelabs.com
Fri Oct 24 01:48:10 PDT 2008





Hi Tobias,

The problem is that you have enabled Looping on the Source.   A looped
Source will never set queued buffers as processed because they are
effectively always pending in this scenario.    So, take this line ...

alSourcei(uiSource, AL_LOOPING, AL_TRUE);

out and the buffers will be marked as processed enabling you to unqueue
them.

Dan
Creative Labs (UK) Ltd.

Notice
The information in this message is confidential and may be legally
privileged.  It is intended solely for the addressee.  Access to this
message by anyone else is unauthorized.  If you are not the intended
recipient,  any disclosure,  copying or distribution of the message,  or
any action taken by you in reliance on it,  is prohibited and may be
unlawful.  If you have received this message in error,  please delete it
and contact the sender immediately.  Thank you.




                                                                           
             -Tobias-                                                      
             <superplus at gmx.ne                                             
             t>                                                         To 
             Sent by:                  openal-devel at opensource.creative.co 
             openal-devel-boun         m                                   
             ces at opensource.cr                                          cc 
             eative.com                                                    
                                                                   Subject 
                                       Re: [Openal-devel] Waveform and     
             10/24/2008 07:09          queued buffers                      
             AM                                                            
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           





Hi,

meanwhile, I switched to the ALUT routines to generate sound which works
fine. No I still have the problem to change the queue content - I hear the
sound (2 different buffers), but when I try to remove the last played one,
I
always get the information that there are no processed buffers...

mexPrintf("Initializing OpenAL...");
    if (!alutInit (NULL, NULL))
    {
        mexPrintf("Failed to initialize OpenAL\n");
        return;
    }else
        mexPrintf("done!\n");

    uiBuffers[0] = alutCreateBufferWaveform(ALUT_WAVEFORM_SINE, 60.0, 0.0,
0.1);
    uiBuffers[1] = alutCreateBufferWaveform(ALUT_WAVEFORM_SINE, 100.0, 0.0,
0.1);

    alGenSources( 1, &uiSource );

    alSourceQueueBuffers(uiSource,2,uiBuffers);
    alSourcei(uiSource, AL_LOOPING, AL_TRUE);
    alSourcePlay( uiSource );

    Sleep(1000);

    alGetSourcei(uiSource, AL_BUFFERS_QUEUED, &processed);
    mexPrintf("Number of loaded buffers: %i\n",processed);

    alGetSourcei(uiSource, AL_BUFFERS_PROCESSED, &processed);
    mexPrintf("Number of processed buffers: %i\n",processed);
    while(processed--)
    {
        ALuint buffer;
        mexPrintf("Unqueuing buffers...");
        alSourceUnqueueBuffers(uiSource, 1, &buffer);
        mexPrintf("done!\n");
        mexPrintf("Generate waveform...");
        uiBuffer = alutCreateBufferWaveform(ALUT_WAVEFORM_SINE, 1000.0,
0.0,
0.1);
        mexPrintf("done!\n");
        mexPrintf("Queuing buffers...");
        alSourceQueueBuffers(uiSource, 1, &buffer);
        mexPrintf("done!\n");
    }

Output:
Initializing OpenAL...done!
Number of loaded buffers: 2
Number of processed buffers: 0

What's the problem here?

Thanks a lot and best regards,

Tobias

--
View this message in context:
http://www.nabble.com/Waveform-and-queued-buffers-tp20127480p20133611.html
Sent from the OpenAL - Dev mailing list archive at Nabble.com.

_______________________________________________
Openal-devel mailing list
Openal-devel at opensource.creative.com
http://opensource.creative.com/mailman/listinfo/openal-devel

ForwardSourceID:NT000663CA



More information about the Openal-devel mailing list