Author Topic: Convert Wasapi GetDeviceLevel to dB  (Read 181 times)

Simulator

  • Posts: 32
Convert Wasapi GetDeviceLevel to dB
« on: 14 Jun '17 - 13:00 »
Hello Guys!

Is it possible to convert the BASS_WASAPI_GetDeviceLevel to decibels? I want to use these values for a VU meter with separate channels, like this:

Code: [Select]
    VUmeter1.Value = BassWasapi.BASS_WASAPI_GetDeviceLevel(23, 0)
            VUmeter2.Value = BassWasapi.BASS_WASAPI_GetDeviceLevel(23, 1)

Thanks.

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: Convert Wasapi GetDeviceLevel to dB
« Reply #1 on: 14 Jun '17 - 17:04 »
You can translate the level to dB like this:

Code: [Select]
float level = BASS_WASAPI_GetDeviceLevel(device, 0);
float db = (level > 0 ? log10(level) * 20 : -1000);