[Openal] buffer size

Jason Champion jchampion at dsci-usa.com
Thu Nov 9 09:02:29 PST 2006


Something that might also be useful to you also are the following functions:

    timeBeginPeriod( uint msec );
    timeEndPeriod( uint msec );

Which can be used to set the Windows timer resolution, but capabilities 
vary.  You can check Windows timer capabilities with:

    timeGetDevCaps( TIMECAPS& tc, sizeof(TIMECAPS) )

   After this call, tc.wPeriodMin and tc.wPeriodMax will give your min 
and max timer resolutions.

Using these functions will require that you link with winmm.lib, but 
they should give you a bit more control over your timer and allow things 
like Sleep(2) to actually sleep 2ms instead of sleeping 10ms.  Look up 
these functions at msdn.microsoft.com for more info.

On Linux it tends to be quite a bit easier since the usleep() 
[microsleep] function is available.

- Jason

nic at weartronics.com wrote:
> Hi Peter,
>
> Thanks for the info, I have read about the kernel granularity now. You 
> are correct it was a thread priority issue. With the thread priority 
> raised, the buffer is serviced even when the window is painting. 
> Everything looks like this will work well for my application now!
>
> Kind regards,
>
> Nic
> _______________________________________________
> Openal mailing list
> Openal at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal
>


More information about the Openal mailing list