BASS_GetCPU

Retrieves the current CPU usage of BASS.

float BASS_GetCPU();

Return value

The BASS CPU usage as a percentage.

Remarks

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.

The CPU usage value includes the time taken by decoding and DSP/FX processing during playback buffer update cycles plus the time taken to produce the final output mix. 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.

If automatic updates are disabled then the playback buffer update cycle CPU usage value is 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.

Platform-specific

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

See also

BASS_CONFIG_UPDATETHREADS, BASS_ATTRIB_CPU