Yes, I think something like that should be possible. You could periodically (eg. in a timer) check the loudness and apply a gain adjustment via the BASS_ATTRIB_VOL setting. If it's for a single file then you could use the BASS_LOUDNESS_INTEGRATED value, which is the average loudness since measurement started. If it's for multiple (or live) sources then you might use the BASS_LOUDNESS_CURRENT value instead and apply your own averaging. Note BASS_LOUDNESS_INTEGRATED is gated so that much quieter parts are ignored, but BASS_LOUDNESS_CURRENT isn't, so you would need to apply your own gating then, ie. ignore the BASS_LOUDNESS_CURRENT value when it's below some threshold.