public static void sample_set_volume(int channel, int volume) {
        if (Machine.sample_rate == 0) {
            return;
        }
        if (Machine.samples == null) {
            return;
        }
        if (channel >= numchannels) {
            if (errorlog != null) {
                fprintf(errorlog, "error: sample_adjust() called with channel = %d, but only %d channels allocated\n", channel, numchannels);
            }
            return;
        }

        mixer_set_volume(channel + firstchannel, volume * 100 / 255);
    }