def _db(gain):
    if gain <= 0:
        return -10000
    return max(-10000, min(int(1000 * math.log(min(gain, 1))), 0))
Convert linear gain in range [0.0, 1.0] to 100ths of dB.
dataset/ETHPy150Open ardekantur/pyglet/experimental/mt_media/drivers/directsound/__init__.py/_db