public static void sample_set_freq(int channel, int freq) {
        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_sample_frequency(channel + firstchannel, freq);
    }