BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_GetCPU Method BASS.NET API for the Un4seen BASS Audio Library
Retrieves the current CPU usage of BASS.

Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version:

public static float BASS_GetCPU()

Return Value

Type: Single
The BASS CPU usage as a percentage of total CPU time.

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. Also, any FX that are not using the "with FX flag" DX8 effect implementation.

The rendering 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 buffer updates are. For example, if it takes 10ms to render 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 rendered, 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(Int32). BASS_ChannelUpdate(Int32, Int32) usage is not included.


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, the CPU usage does include sample playback as well as the generation of the final output mix.

See Also