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

19
LINES

< > BotCompany Repo | #1018640 // autoClipRecording (old)

JavaX fragment (include)

1  
static Pair<L<IntRange>, File> autoClipRecording(S name) {
2  
  ret autoClipRecording(recordingsDir(name));
3  
}
4  
  
5  
static Pair<L<IntRange>, File> autoClipRecording(File f) {
6  
  Clip clip = spectro_clipFromFile(f);
7  
  BWImage img = clipToFrequencyImage(clip);
8  
  L<IntRange> parts = audioSplit3(img);
9  
  File clipFile = fileInSubDir(f, "clipped");
10  
  File imgFile = replaceExtension(clipFile, ".png");
11  
  if (empty(parts))
12  
    deleteFiles(clipFile, imgFile);
13  
  else {
14  
    spectro_intRangesToWAV(clip, parts, clipFile);
15  
    savePNG(imgFile,
16  
      mergeBWImagesHorizontally(horizontalIntRangesToImages(img, parts), spaceColor := 0).getBufferedImage());
17  
  }
18  
  ret pair(parts, clipFile);
19  
}

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: #1018640
Snippet name: autoClipRecording (old)
Eternal ID of this version: #1018640/9
Text MD5: 0697a78ed123fae39bd37f10ef6f60ef
Author: stefan
Category: javax / audio recognition
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-14 13:34:25
Source code size: 691 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 402 / 452
Version history: 8 change(s)
Referenced in: [show references]