It sounds like you want to get the level of the sound rather than a volume control? BASS_SetVolume/GetVolume (when available) provides the latter. One way you can get the level of the BASS output is to set a level-measuring DSP function on the output mix stream. For example, something like this:
int mixstream; // output mix stream
float mixlevel; // current level
BASS.DSPPROC MeasureLevel = new BASS.DSPPROC() {
public void DSPPROC(int handle, int channel, ByteBuffer buffer, int length, Object user) {
buffer.order(null); // little-endian
FloatBuffer ibuffer = buffer.asFloatBuffer();
float[] d = new float[length / 4]; // allocate array for data
ibuffer.get(d); // copy data from buffer to array
float level = 0;
for (int a = 0; a < length / 4; a++) {
if (level < Math.abs(d[a])) level = Math.abs(d[a]);
}
mixlevel = level;
}
};
mixstream = BASS.BASS_StreamCreate(0, 0, 0, BASS.STREAMPROC_DEVICE, null); // get output mix stream
BASS.BASS_ChannelSetDSP(mixstream, MeasureLevel, null, 0); // set level measuring DSP on it