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

10
LINES

< > BotCompany Repo | #1018699 // CutOffSoundSource - end after a certain time

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3214L/18K).

srecord CutOffSoundSource(double seconds, VF1<double[]> source) extends VF1<double[]> {
  long count;
  
  public void get(double[] lr) {
    if (count++ < seconds*44100)
      source.get(lr);
    else
      lr[0] = Double.NaN; // mark end
  }
}

Author comment

Began life as a copy of #1018698

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018699
Snippet name: CutOffSoundSource - end after a certain time
Eternal ID of this version: #1018699/4
Text MD5: e22faa5c9699d10b8c32f4d558020f11
Transpilation MD5: 03b74b1132220f345b31a12324fa62d7
Author: stefan
Category: javax / audio
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-03 03:11:22
Source code size: 254 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 293 / 885
Version history: 3 change(s)
Referenced in: #1018703 - GainSoundSource - change volume
#1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)