Retrieves the current CPU usage of BASS.

float BASS_GetCPU();

Return value

The BASS CPU usage as a percentage.


This function includes the time taken to render stream (HSTREAM) and MOD music (HMUSIC) channels during playback, and any DSP functions set on those channels. It also includes any FX that are not using the "with FX flag" DX8 effect implementation. The processing of some add-on stream formats may not be entirely included, if they use additional decoding threads; see the add-on documentation for details.

This function does not strictly tell the CPU usage, but rather how timely the processing is. For example, if it takes 10ms to generate 100ms of data, that would be 10%. If the reported usage gets to 100%, that means the channel data is being played faster than it can be generated and buffer underruns are likely to occur.

If automatic updating is disabled, then the value returned by this function is only updated after each call to BASS_Update. BASS_ChannelUpdate usage is not included. The CPU usage of an individual channel is available via the BASS_ATTRIB_CPU attribute.


When using DirectSound output on Windows, the CPU usage does not include sample channels (HCHANNEL), which are mixed by the output device/drivers (hardware mixing) or Windows (software mixing). On other platforms and when using WASAPI output on Windows, the CPU usage does include sample playback as well as the generation of the final output mix.

On Windows, the CPU usage value does not include the decoding of internet (or "buffered" user file) streams that use Media Foundation codecs.

See also