Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

10
LINES

< > BotCompany Repo | #1016686 // stereoSamplesIterator - loops

JavaX fragment (include)

static VF1<double[]> stereoSamplesIterator(final short[] samples) {
  ret samples == null ? null : new VF1<double[]>() {
    int sampleIndex = 0;
    public void get(double[] pair) {
      pair[0] = samples[sampleIndex];
      pair[1] = samples[sampleIndex+1];
      sampleIndex = (sampleIndex+2) % l(samples);
    }
  };
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016686
Snippet name: stereoSamplesIterator - loops
Eternal ID of this version: #1016686/5
Text MD5: 021b110e6e6b8c3d49e1122a2e96bb2e
Author: stefan
Category: javax / sound
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-08 16:18:37
Source code size: 332 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 400 / 450
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1018672 - stereoSamplesIterator_single - doesn't loop
#1020125 - stereoSamplesIterator_longCounter