srecord noeq SampleIteratorToQuerySound(int channels, ShortIterator it) is IQuerySound { int idx = 0; public int channels() { ret channels; } public double getSample(int channel, double time) { int t = ifloor(time); if (t != idx) fail("Wrong time queried: " + time + " / " + idx); ++idx; if (it == null) ret 0; else if (!it.hasNext()) { it = null; ret 0; } else ret it.next(); } }