static IQuerySound shortSamplesToQuerySound(int channels default 1, short[] samples) { ret new IQuerySound { public int channels() { ret channels; } // time is in samples public double getSample(int channel, double time) { int t = ifloor(time); t /= channels; ret t < 0 || t >= l(samples) ? 0 : samples[t]; } }; }